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.
Files changed (163) hide show
  1. package/.dependency-cruiser.cjs +412 -0
  2. package/.github/workflows/ci.yml +2 -2
  3. package/.imdoneignore +2 -1
  4. package/README.md +2 -2
  5. package/_index.md +7 -0
  6. package/build.js +57 -0
  7. package/esm-migration.md +446 -0
  8. package/lib/FileProjectContext.js +13 -0
  9. package/lib/ProjectContext.js +19 -18
  10. package/lib/adapters/date-time.js +3 -8
  11. package/lib/adapters/environment.js +3 -0
  12. package/lib/adapters/file-gateway.js +133 -106
  13. package/lib/adapters/git-download.js +36 -16
  14. package/lib/adapters/index.js +9 -0
  15. package/lib/adapters/logger.js +136 -0
  16. package/lib/adapters/markdown.js +31 -19
  17. package/lib/adapters/parsers/DateLanguageParser.js +11 -9
  18. package/lib/adapters/parsers/content-transformer.js +35 -30
  19. package/lib/adapters/parsers/file/LocalFileParserFactory.js +8 -9
  20. package/lib/adapters/parsers/file/ReadStreamCodeParser.js +8 -8
  21. package/lib/adapters/parsers/file/ReadStreamMarkdownParser.js +4 -4
  22. package/lib/adapters/parsers/file/ReadStreamTaskParser.js +5 -3
  23. package/lib/adapters/parsers/file/index.js +4 -0
  24. package/lib/adapters/parsers/function-parser.js +1 -5
  25. package/lib/adapters/parsers/index.js +5 -0
  26. package/lib/adapters/parsers/task/CardContentParser.js +23 -32
  27. package/lib/adapters/parsers/task/CheckStyleTaskParser.js +2 -2
  28. package/lib/adapters/parsers/task/CodeStyleTaskParser.js +2 -2
  29. package/lib/adapters/parsers/task/HashStyleTaskParser.js +3 -3
  30. package/lib/adapters/parsers/task/MarkdownStyleTaskParser.js +2 -2
  31. package/lib/adapters/parsers/task/TaskParser.js +1 -1
  32. package/lib/adapters/parsers/task/index.js +6 -0
  33. package/lib/adapters/storage/config.js +15 -20
  34. package/lib/adapters/storage/index.js +2 -0
  35. package/lib/adapters/storage/tags.js +11 -12
  36. package/lib/adapters/yaml.js +8 -5
  37. package/lib/card.js +25 -26
  38. package/lib/checksum.js +22 -0
  39. package/lib/cli.js +114 -0
  40. package/lib/config.js +106 -71
  41. package/lib/constants.js +21 -50
  42. package/lib/context/ApplicationContext.js +7 -4
  43. package/lib/context/index.js +1 -0
  44. package/lib/default-settings.js +3 -3
  45. package/lib/domain/entities/View.js +4 -11
  46. package/lib/domain/entities/index.js +1 -0
  47. package/lib/domain/index.js +2 -0
  48. package/lib/domain/usecases/GetViewsUsecase.js +6 -12
  49. package/lib/domain/usecases/SaveViewUsecase.js +8 -14
  50. package/lib/domain/usecases/index.js +2 -0
  51. package/lib/file.js +1158 -1162
  52. package/lib/get-tasks-to-modify.js +117 -0
  53. package/lib/index.js +23 -0
  54. package/lib/languages.js +4 -5
  55. package/lib/list.js +46 -95
  56. package/lib/migrate-config.js +5 -5
  57. package/lib/mixins/index.js +2 -0
  58. package/lib/mixins/repo-fs-store.js +224 -289
  59. package/lib/mixins/repo-watched-fs-store.js +158 -147
  60. package/lib/plugins/archive-plugin.js +10 -8
  61. package/lib/plugins/default-board-actions-plugin.js +2 -2
  62. package/lib/plugins/default-board-properties-plugin.js +7 -7
  63. package/lib/plugins/default-plugins.js +7 -0
  64. package/lib/plugins/epic-plugin.js +6 -5
  65. package/lib/plugins/extension-plugin.js +24 -17
  66. package/lib/plugins/index.js +9 -0
  67. package/lib/plugins/persist-tags-plugin.js +4 -3
  68. package/lib/plugins/plugin-manager.js +89 -52
  69. package/lib/plugins/plugin-registry.js +12 -16
  70. package/lib/project-factory.js +21 -24
  71. package/lib/project.js +97 -144
  72. package/lib/repository.js +1323 -1555
  73. package/lib/task.js +562 -580
  74. package/lib/tools.js +39 -113
  75. package/lib/usecases/actions.js +32 -0
  76. package/lib/usecases/get-project-tags.js +3 -12
  77. package/lib/usecases/get-tasks-in-file.js +4 -7
  78. package/lib/usecases/index.js +4 -0
  79. package/package.json +44 -66
  80. package/scripts/delete-markdown-indexes.js +87 -0
  81. package/scripts/generate-index.js +35 -0
  82. package/{index-markdown.js → scripts/index-markdown.js} +7 -7
  83. package/tsconfig.json +15 -0
  84. package/types/FileProjectContext.d.ts +4 -0
  85. package/types/ProjectContext.d.ts +9 -0
  86. package/types/adapters/date-time.d.ts +2 -0
  87. package/types/adapters/environment.d.ts +1 -0
  88. package/types/adapters/file-gateway.d.ts +51 -0
  89. package/types/adapters/git-download.d.ts +1 -0
  90. package/types/adapters/index.d.ts +9 -0
  91. package/types/adapters/logger.d.ts +24 -0
  92. package/types/adapters/markdown.d.ts +13 -0
  93. package/types/adapters/parsers/DateLanguageParser.d.ts +1 -0
  94. package/types/adapters/parsers/content-transformer.d.ts +10 -0
  95. package/types/adapters/parsers/file/LocalFileParserFactory.d.ts +5 -0
  96. package/types/adapters/parsers/file/ReadStreamCodeParser.d.ts +13 -0
  97. package/types/adapters/parsers/file/ReadStreamMarkdownParser.d.ts +7 -0
  98. package/types/adapters/parsers/file/ReadStreamTaskParser.d.ts +19 -0
  99. package/types/adapters/parsers/file/index.d.ts +4 -0
  100. package/types/adapters/parsers/function-parser.d.ts +1 -0
  101. package/types/adapters/parsers/index.d.ts +5 -0
  102. package/types/adapters/parsers/task/CardContentParser.d.ts +45 -0
  103. package/types/adapters/parsers/task/CheckStyleTaskParser.d.ts +12 -0
  104. package/types/adapters/parsers/task/CodeStyleTaskParser.d.ts +14 -0
  105. package/types/adapters/parsers/task/HashStyleTaskParser.d.ts +13 -0
  106. package/types/adapters/parsers/task/MarkdownStyleTaskParser.d.ts +14 -0
  107. package/types/adapters/parsers/task/TaskParser.d.ts +7 -0
  108. package/types/adapters/parsers/task/index.d.ts +6 -0
  109. package/types/adapters/storage/config.d.ts +6 -0
  110. package/types/adapters/storage/index.d.ts +2 -0
  111. package/types/adapters/storage/tags.d.ts +3 -0
  112. package/types/adapters/yaml.d.ts +2 -0
  113. package/types/card.d.ts +166 -0
  114. package/types/checksum.d.ts +8 -0
  115. package/types/config.d.ts +61 -0
  116. package/types/constants.d.ts +46 -0
  117. package/types/context/ApplicationContext.d.ts +24 -0
  118. package/types/context/index.d.ts +1 -0
  119. package/types/default-settings.d.ts +2 -0
  120. package/types/domain/entities/FileProjectContext.d.ts +5 -0
  121. package/types/domain/entities/View.d.ts +17 -0
  122. package/types/domain/entities/index.d.ts +1 -0
  123. package/types/domain/index.d.ts +2 -0
  124. package/types/domain/usecases/GetViewsUsecase.d.ts +4 -0
  125. package/types/domain/usecases/SaveViewUsecase.d.ts +8 -0
  126. package/types/domain/usecases/index.d.ts +2 -0
  127. package/types/file.d.ts +344 -0
  128. package/types/get-tasks-to-modify.d.ts +3 -0
  129. package/types/index.d.ts +23 -0
  130. package/types/languages.d.ts +649 -0
  131. package/types/list.d.ts +30 -0
  132. package/types/migrate-config.d.ts +1 -0
  133. package/types/mixins/index.d.ts +2 -0
  134. package/types/mixins/repo-fs-store.d.ts +2 -0
  135. package/types/mixins/repo-watched-fs-store.d.ts +2 -0
  136. package/types/plugins/archive-plugin.d.ts +8 -0
  137. package/types/plugins/default-board-actions-plugin.d.ts +9 -0
  138. package/types/plugins/default-board-properties-plugin.d.ts +16 -0
  139. package/types/plugins/default-plugins.d.ts +6 -0
  140. package/types/plugins/epic-plugin.d.ts +19 -0
  141. package/types/plugins/extension-plugin.d.ts +15 -0
  142. package/types/plugins/index.d.ts +9 -0
  143. package/types/plugins/persist-tags-plugin.d.ts +4 -0
  144. package/types/plugins/plugin-manager.d.ts +68 -0
  145. package/types/plugins/plugin-registry.d.ts +1 -0
  146. package/types/project-factory.d.ts +14 -0
  147. package/types/project.d.ts +158 -0
  148. package/types/repository.d.ts +996 -0
  149. package/types/task.d.ts +202 -0
  150. package/types/tools.d.ts +29 -0
  151. package/types/usecases/actions.d.ts +7 -0
  152. package/types/usecases/get-imdone-url.d.ts +1 -0
  153. package/types/usecases/get-project-tags.d.ts +1 -0
  154. package/types/usecases/get-tasks-in-file.d.ts +4 -0
  155. package/types/usecases/index.d.ts +4 -0
  156. package/vitest.config.js +13 -0
  157. package/cli.js +0 -74
  158. package/index.js +0 -1
  159. package/lib/adapters/readers/FileSystemProjectReader.js +0 -45
  160. package/lib/context/StreamingApplicationContext.js +0 -31
  161. package/lib/controlers/SaveViewController.js +0 -10
  162. package/lib/domain/entities/FileProjectContext.js +0 -10
  163. package/lib/domain/usecases/OpenProjectUsecase.js +0 -13
@@ -0,0 +1,412 @@
1
+ /** @type {import('dependency-cruiser').IConfiguration} */
2
+ module.exports = {
3
+ forbidden: [
4
+ {
5
+ name: 'no-circular',
6
+ severity: 'warn',
7
+ comment:
8
+ 'This dependency is part of a circular relationship. You might want to revise ' +
9
+ 'your solution (i.e. use dependency inversion, make sure the modules have a single responsibility) ',
10
+ from: {},
11
+ to: {
12
+ circular: true
13
+ }
14
+ },
15
+ {
16
+ name: 'no-orphans',
17
+ comment:
18
+ "This is an orphan module - it's likely not used (anymore?). Either use it or " +
19
+ "remove it. If it's logical this module is an orphan (i.e. it's a config file), " +
20
+ "add an exception for it in your dependency-cruiser configuration. By default " +
21
+ "this rule does not scrutinize dot-files (e.g. .eslintrc.js), TypeScript declaration " +
22
+ "files (.d.ts), tsconfig.json and some of the babel and webpack configs.",
23
+ severity: 'warn',
24
+ from: {
25
+ orphan: true,
26
+ pathNot: [
27
+ '(^|/)[.][^/]+[.](?:js|cjs|mjs|ts|cts|mts|json)$', // dot files
28
+ '[.]d[.]ts$', // TypeScript declaration files
29
+ '(^|/)tsconfig[.]json$', // TypeScript config
30
+ '(^|/)(?:babel|webpack)[.]config[.](?:js|cjs|mjs|ts|cts|mts|json)$' // other configs
31
+ ]
32
+ },
33
+ to: {},
34
+ },
35
+ {
36
+ name: 'no-deprecated-core',
37
+ comment:
38
+ 'A module depends on a node core module that has been deprecated. Find an alternative - these are ' +
39
+ "bound to exist - node doesn't deprecate lightly.",
40
+ severity: 'warn',
41
+ from: {},
42
+ to: {
43
+ dependencyTypes: [
44
+ 'core'
45
+ ],
46
+ path: [
47
+ '^v8/tools/codemap$',
48
+ '^v8/tools/consarray$',
49
+ '^v8/tools/csvparser$',
50
+ '^v8/tools/logreader$',
51
+ '^v8/tools/profile_view$',
52
+ '^v8/tools/profile$',
53
+ '^v8/tools/SourceMap$',
54
+ '^v8/tools/splaytree$',
55
+ '^v8/tools/tickprocessor-driver$',
56
+ '^v8/tools/tickprocessor$',
57
+ '^node-inspect/lib/_inspect$',
58
+ '^node-inspect/lib/internal/inspect_client$',
59
+ '^node-inspect/lib/internal/inspect_repl$',
60
+ '^async_hooks$',
61
+ '^punycode$',
62
+ '^domain$',
63
+ '^constants$',
64
+ '^sys$',
65
+ '^_linklist$',
66
+ '^_stream_wrap$'
67
+ ],
68
+ }
69
+ },
70
+ {
71
+ name: 'not-to-deprecated',
72
+ comment:
73
+ 'This module uses a (version of an) npm module that has been deprecated. Either upgrade to a later ' +
74
+ 'version of that module, or find an alternative. Deprecated modules are a security risk.',
75
+ severity: 'warn',
76
+ from: {},
77
+ to: {
78
+ dependencyTypes: [
79
+ 'deprecated'
80
+ ]
81
+ }
82
+ },
83
+ {
84
+ name: 'no-non-package-json',
85
+ severity: 'error',
86
+ comment:
87
+ "This module depends on an npm package that isn't in the 'dependencies' section of your package.json. " +
88
+ "That's problematic as the package either (1) won't be available on live (2 - worse) will be " +
89
+ "available on live with an non-guaranteed version. Fix it by adding the package to the dependencies " +
90
+ "in your package.json.",
91
+ from: {},
92
+ to: {
93
+ dependencyTypes: [
94
+ 'npm-no-pkg',
95
+ 'npm-unknown'
96
+ ]
97
+ }
98
+ },
99
+ {
100
+ name: 'not-to-unresolvable',
101
+ comment:
102
+ "This module depends on a module that cannot be found ('resolved to disk'). If it's an npm " +
103
+ 'module: add it to your package.json. In all other cases you likely already know what to do.',
104
+ severity: 'error',
105
+ from: {},
106
+ to: {
107
+ couldNotResolve: true
108
+ }
109
+ },
110
+ {
111
+ name: 'no-duplicate-dep-types',
112
+ comment:
113
+ "Likely this module depends on an external ('npm') package that occurs more than once " +
114
+ "in your package.json i.e. bot as a devDependencies and in dependencies. This will cause " +
115
+ "maintenance problems later on.",
116
+ severity: 'warn',
117
+ from: {},
118
+ to: {
119
+ moreThanOneDependencyType: true,
120
+ // as it's pretty common to have a type import be a type only import
121
+ // _and_ (e.g.) a devDependency - don't consider type-only dependency
122
+ // types for this rule
123
+ dependencyTypesNot: ["type-only"]
124
+ }
125
+ },
126
+
127
+ /* rules you might want to tweak for your specific situation: */
128
+ {
129
+ name: 'not-to-test',
130
+ comment:
131
+ "This module depends on code within a folder that should only contain tests. As tests don't " +
132
+ "implement functionality this is odd. Either you're writing a test outside the test folder " +
133
+ "or there's something in the test folder that isn't a test.",
134
+ severity: 'error',
135
+ from: {
136
+ pathNot: '^(test)'
137
+ },
138
+ to: {
139
+ path: '^(test)'
140
+ }
141
+ },
142
+ {
143
+ name: 'not-to-spec',
144
+ comment:
145
+ 'This module depends on a spec (test) file. The sole responsibility of a spec file is to test code. ' +
146
+ "If there's something in a spec that's of use to other modules, it doesn't have that single " +
147
+ 'responsibility anymore. Factor it out into (e.g.) a separate utility/ helper or a mock.',
148
+ severity: 'error',
149
+ from: {},
150
+ to: {
151
+ path: '[.](?:spec|test)[.](?:js|mjs|cjs|jsx|ts|mts|cts|tsx)$'
152
+ }
153
+ },
154
+ {
155
+ name: 'not-to-dev-dep',
156
+ severity: 'error',
157
+ comment:
158
+ "This module depends on an npm package from the 'devDependencies' section of your " +
159
+ 'package.json. It looks like something that ships to production, though. To prevent problems ' +
160
+ "with npm packages that aren't there on production declare it (only!) in the 'dependencies'" +
161
+ 'section of your package.json. If this module is development only - add it to the ' +
162
+ 'from.pathNot re of the not-to-dev-dep rule in the dependency-cruiser configuration',
163
+ from: {
164
+ path: '^(lib)',
165
+ pathNot: '[.](?:spec|test)[.](?:js|mjs|cjs|jsx|ts|mts|cts|tsx)$'
166
+ },
167
+ to: {
168
+ dependencyTypes: [
169
+ 'npm-dev',
170
+ ],
171
+ // type only dependencies are not a problem as they don't end up in the
172
+ // production code or are ignored by the runtime.
173
+ dependencyTypesNot: [
174
+ 'type-only'
175
+ ],
176
+ pathNot: [
177
+ 'node_modules/@types/'
178
+ ]
179
+ }
180
+ },
181
+ {
182
+ name: 'optional-deps-used',
183
+ severity: 'info',
184
+ comment:
185
+ "This module depends on an npm package that is declared as an optional dependency " +
186
+ "in your package.json. As this makes sense in limited situations only, it's flagged here. " +
187
+ "If you're using an optional dependency here by design - add an exception to your" +
188
+ "dependency-cruiser configuration.",
189
+ from: {},
190
+ to: {
191
+ dependencyTypes: [
192
+ 'npm-optional'
193
+ ]
194
+ }
195
+ },
196
+ {
197
+ name: 'peer-deps-used',
198
+ comment:
199
+ "This module depends on an npm package that is declared as a peer dependency " +
200
+ "in your package.json. This makes sense if your package is e.g. a plugin, but in " +
201
+ "other cases - maybe not so much. If the use of a peer dependency is intentional " +
202
+ "add an exception to your dependency-cruiser configuration.",
203
+ severity: 'warn',
204
+ from: {},
205
+ to: {
206
+ dependencyTypes: [
207
+ 'npm-peer'
208
+ ]
209
+ }
210
+ }
211
+ ],
212
+ options: {
213
+
214
+ /* Which modules not to follow further when encountered */
215
+ doNotFollow: {
216
+ /* path: an array of regular expressions in strings to match against */
217
+ path: ['node_modules']
218
+ },
219
+
220
+ /* Which modules to exclude */
221
+ // exclude : {
222
+ // /* path: an array of regular expressions in strings to match against */
223
+ // path: '',
224
+ // },
225
+
226
+ /* Which modules to exclusively include (array of regular expressions in strings)
227
+ dependency-cruiser will skip everything not matching this pattern
228
+ */
229
+ // includeOnly : [''],
230
+
231
+ /* List of module systems to cruise.
232
+ When left out dependency-cruiser will fall back to the list of _all_
233
+ module systems it knows of. It's the default because it's the safe option
234
+ It might come at a performance penalty, though.
235
+ moduleSystems: ['amd', 'cjs', 'es6', 'tsd']
236
+
237
+ As in practice only commonjs ('cjs') and ecmascript modules ('es6')
238
+ are widely used, you can limit the moduleSystems to those.
239
+ */
240
+
241
+ // moduleSystems: ['cjs', 'es6'],
242
+
243
+ /*
244
+ false: don't look at JSDoc imports (the default)
245
+ true: dependency-cruiser will detect dependencies in JSDoc-style
246
+ import statements. Implies "parser": "tsc", so the dependency-cruiser
247
+ will use the typescript parser for JavaScript files.
248
+
249
+ For this to work the typescript compiler will need to be installed in the
250
+ same spot as you're running dependency-cruiser from.
251
+ */
252
+ // detectJSDocImports: true,
253
+
254
+ /* prefix for links in html and svg output (e.g. 'https://github.com/you/yourrepo/blob/main/'
255
+ to open it on your online repo or `vscode://file/${process.cwd()}/` to
256
+ open it in visual studio code),
257
+ */
258
+ // prefix: `vscode://file/${process.cwd()}/`,
259
+
260
+ /* false (the default): ignore dependencies that only exist before typescript-to-javascript compilation
261
+ true: also detect dependencies that only exist before typescript-to-javascript compilation
262
+ "specify": for each dependency identify whether it only exists before compilation or also after
263
+ */
264
+ // tsPreCompilationDeps: false,
265
+
266
+ /* list of extensions to scan that aren't javascript or compile-to-javascript.
267
+ Empty by default. Only put extensions in here that you want to take into
268
+ account that are _not_ parsable.
269
+ */
270
+ // extraExtensionsToScan: [".json", ".jpg", ".png", ".svg", ".webp"],
271
+
272
+ /* if true combines the package.jsons found from the module up to the base
273
+ folder the cruise is initiated from. Useful for how (some) mono-repos
274
+ manage dependencies & dependency definitions.
275
+ */
276
+ // combinedDependencies: false,
277
+
278
+ /* if true leave symlinks untouched, otherwise use the realpath */
279
+ // preserveSymlinks: false,
280
+
281
+ /* TypeScript project file ('tsconfig.json') to use for
282
+ (1) compilation and
283
+ (2) resolution (e.g. with the paths property)
284
+
285
+ The (optional) fileName attribute specifies which file to take (relative to
286
+ dependency-cruiser's current working directory). When not provided
287
+ defaults to './tsconfig.json'.
288
+ */
289
+ // tsConfig: {
290
+ // fileName: 'tsconfig.json'
291
+ // },
292
+
293
+ /* Webpack configuration to use to get resolve options from.
294
+
295
+ The (optional) fileName attribute specifies which file to take (relative
296
+ to dependency-cruiser's current working directory. When not provided defaults
297
+ to './webpack.conf.js'.
298
+
299
+ The (optional) `env` and `arguments` attributes contain the parameters
300
+ to be passed if your webpack config is a function and takes them (see
301
+ webpack documentation for details)
302
+ */
303
+ // webpackConfig: {
304
+ // fileName: 'webpack.config.js',
305
+ // env: {},
306
+ // arguments: {}
307
+ // },
308
+
309
+ /* Babel config ('.babelrc', '.babelrc.json', '.babelrc.json5', ...) to use
310
+ for compilation
311
+ */
312
+ // babelConfig: {
313
+ // fileName: '.babelrc',
314
+ // },
315
+
316
+ /* List of strings you have in use in addition to cjs/ es6 requires
317
+ & imports to declare module dependencies. Use this e.g. if you've
318
+ re-declared require, use a require-wrapper or use window.require as
319
+ a hack.
320
+ */
321
+ // exoticRequireStrings: [],
322
+
323
+ /* options to pass on to enhanced-resolve, the package dependency-cruiser
324
+ uses to resolve module references to disk. The values below should be
325
+ suitable for most situations
326
+
327
+ If you use webpack: you can also set these in webpack.conf.js. The set
328
+ there will override the ones specified here.
329
+ */
330
+ enhancedResolveOptions: {
331
+ /* What to consider as an 'exports' field in package.jsons */
332
+ exportsFields: ["exports"],
333
+ /* List of conditions to check for in the exports field.
334
+ Only works when the 'exportsFields' array is non-empty.
335
+ */
336
+ conditionNames: ["import", "require", "node", "default", "types"],
337
+ /* The extensions, by default are the same as the ones dependency-cruiser
338
+ can access (run `npx depcruise --info` to see which ones that are in
339
+ _your_ environment). If that list is larger than you need you can pass
340
+ the extensions you actually use (e.g. [".js", ".jsx"]). This can speed
341
+ up module resolution, which is the most expensive step.
342
+ */
343
+ // extensions: [".js", ".jsx", ".ts", ".tsx", ".d.ts"],
344
+ /* What to consider a 'main' field in package.json */
345
+
346
+ // if you migrate to ESM (or are in an ESM environment already) you will want to
347
+ // have "module" in the list of mainFields, like so:
348
+ // mainFields: ["module", "main", "types", "typings"],
349
+ mainFields: ["main", "types", "typings"],
350
+ /* A list of alias fields in package.jsons
351
+
352
+ See [this specification](https://github.com/defunctzombie/package-browser-field-spec) and
353
+ the webpack [resolve.alias](https://webpack.js.org/configuration/resolve/#resolvealiasfields)
354
+ documentation.
355
+
356
+ Defaults to an empty array (= don't use alias fields).
357
+ */
358
+ // aliasFields: ["browser"],
359
+ },
360
+
361
+ /* skipAnalysisNotInRules will make dependency-cruiser execute
362
+ analysis strictly necessary for checking the rule set only.
363
+
364
+ See https://github.com/sverweij/dependency-cruiser/blob/main/doc/options-reference.md#skipanalysisnotinrules
365
+ for details
366
+ */
367
+ skipAnalysisNotInRules: true,
368
+
369
+ reporterOptions: {
370
+ dot: {
371
+ /* pattern of modules that can be consolidated in the detailed
372
+ graphical dependency graph. The default pattern in this configuration
373
+ collapses everything in node_modules to one folder deep so you see
374
+ the external modules, but their innards.
375
+ */
376
+ collapsePattern: 'node_modules/(?:@[^/]+/[^/]+|[^/]+)',
377
+
378
+ /* Options to tweak the appearance of your graph.See
379
+ https://github.com/sverweij/dependency-cruiser/blob/main/doc/options-reference.md#reporteroptions
380
+ for details and some examples. If you don't specify a theme
381
+ dependency-cruiser falls back to a built-in one.
382
+ */
383
+ // theme: {
384
+ // graph: {
385
+ // /* splines: "ortho" gives straight lines, but is slow on big graphs
386
+ // splines: "true" gives bezier curves (fast, not as nice as ortho)
387
+ // */
388
+ // splines: "true"
389
+ // },
390
+ // }
391
+ },
392
+ archi: {
393
+ /* pattern of modules that can be consolidated in the high level
394
+ graphical dependency graph. If you use the high level graphical
395
+ dependency graph reporter (`archi`) you probably want to tweak
396
+ this collapsePattern to your situation.
397
+ */
398
+ collapsePattern: '^(?:packages|src|lib(s?)|app(s?)|bin|test(s?)|spec(s?))/[^/]+|node_modules/(?:@[^/]+/[^/]+|[^/]+)',
399
+
400
+ /* Options to tweak the appearance of your graph. If you don't specify a
401
+ theme for 'archi' dependency-cruiser will use the one specified in the
402
+ dot section above and otherwise use the default one.
403
+ */
404
+ // theme: { },
405
+ },
406
+ "text": {
407
+ "highlightFocused": true
408
+ },
409
+ }
410
+ }
411
+ };
412
+ // generated: dependency-cruiser@16.10.0 on 2025-03-11T18:41:16.528Z
@@ -11,7 +11,7 @@ jobs:
11
11
 
12
12
  strategy:
13
13
  matrix:
14
- node-version: [16.x, 17.x, 18.x, 19.x, 20.x]
14
+ node-version: [22.x]
15
15
 
16
16
  steps:
17
17
  - uses: actions/checkout@v3
@@ -21,4 +21,4 @@ jobs:
21
21
  node-version: ${{ matrix.node-version }}
22
22
  cache: 'npm'
23
23
  - run: npm i
24
- - run: npm run build --if-present
24
+ - run: npm run coverage --if-present
package/.imdoneignore CHANGED
@@ -3,9 +3,10 @@ coverage
3
3
  test/repos
4
4
  test/files
5
5
  test/file-spec.js
6
- __tests__
7
6
  test-big-file.md
8
7
  tmp
8
+ dist
9
+ types
9
10
  imdone-export.json
10
11
  .imdone/templates
11
12
  .imdone
package/README.md CHANGED
@@ -9,7 +9,6 @@ Imdone is text based kanban processor with a simple syntax that uses [comment ta
9
9
  <!-- START doctoc generated TOC please keep comment here to allow auto update -->
10
10
  <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
11
11
 
12
-
13
12
  - [Imdone format](#imdone-format)
14
13
  - [Code Style](#code-style)
15
14
  - [Hash Style](#hash-style)
@@ -203,8 +202,9 @@ License
203
202
  {{version}} :package: :hammer_and_wrench: Code Version
204
203
  {{publishedVersion}} :package: :passenger_ship: Published Version
205
204
 
205
+ [ESM Migration]({{getFilterURL('list = NOTE or allTags = "esm-migration"')}})
206
206
  [Focus]({{getFilterURL('list = DOING or tags = focus')}})
207
- [Plan]({{getFilterURL(' ')}})
207
+ [Plan]({{clearFilterURL}})
208
208
 
209
209
  <!--
210
210
  expand:1
package/_index.md ADDED
@@ -0,0 +1,7 @@
1
+ # imdone-core
2
+
3
+ - [:file_folder: **docs**](docs/README)
4
+ - [:file_folder: **notes**](notes/_index.md)
5
+ - [CHANGELOG](CHANGELOG.md)
6
+ - [README](README.md)
7
+ - [esm-migration](esm-migration.md)
package/build.js ADDED
@@ -0,0 +1,57 @@
1
+ import { build } from "esbuild";
2
+ import { readFile, writeFile, stat, chmod } from "fs/promises";
3
+
4
+ // Read dependencies from package.json
5
+ const packageJson = JSON.parse(await readFile(new URL("./package.json", import.meta.url), "utf8"));
6
+ const externalDeps = Object.keys(packageJson.dependencies || {});
7
+
8
+ async function getFileSize(filePath) {
9
+ const stats = await stat(filePath);
10
+ return (stats.size / 1024).toFixed(2); // Convert bytes to kilobytes and format to 2 decimal places
11
+ }
12
+
13
+ await Promise.all([
14
+ build({
15
+ entryPoints: ["lib/index.js"], // Main library entry point
16
+ bundle: true,
17
+ format: "esm",
18
+ platform: "node",
19
+ sourcemap: false,
20
+ external: externalDeps,
21
+ outdir: "dist",
22
+ }).then(async () => {
23
+ const size = await getFileSize("dist/index.js");
24
+ console.log(`✅ Main library bundle size: ${size} KB`);
25
+ }),
26
+ build({
27
+ entryPoints: ["lib/cli.js"], // CLI entry point
28
+ bundle: true,
29
+ format: "esm", // Use CommonJS format for CLI
30
+ platform: "node",
31
+ sourcemap: false,
32
+ external: [...externalDeps], // Add Node.js built-in modules to external dependencies
33
+ outfile: "dist/cli.js",
34
+ loader: {
35
+ ".js": "js",
36
+ ".json": "json"
37
+ }, // ✅ Tell esbuild to handle JSON files
38
+ }).then(async () => {
39
+ // Restore the shebang after bundling
40
+ const cliPath = "dist/cli.js";
41
+ let content = await readFile(cliPath, "utf8");
42
+ if (!content.startsWith('#!/usr/bin/env node')) {
43
+ content = `#!/usr/bin/env node\n${content}`;
44
+ await writeFile(cliPath, content);
45
+ console.log("✅ Shebang restored in CLI build");
46
+ }
47
+
48
+ // Give the CLI script executable permissions
49
+ await chmod(cliPath, 0o755);
50
+ console.log("✅ Executable permissions set for CLI build");
51
+
52
+ const size = await getFileSize(cliPath);
53
+ console.log(`✅ CLI bundle size: ${size} KB`);
54
+ }),
55
+ ]);
56
+
57
+ console.log("✅ Build successful");