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
@@ -1,25 +1,39 @@
1
- const Emitter = require('events')
2
- const Plugin = require('imdone-api')
3
- const _path = require('path')
4
- const downloadRepo = require('../adapters/git-download')
5
- const rimraf = require('rimraf')
6
- const sane = require('sane')
7
- const debounce = require('lodash.debounce')
8
- const { exists, mkdir, readdir } = require('../adapters/file-gateway')
9
- const appContext = require('../context/ApplicationContext')
10
-
11
- module.exports = class PluginManager extends Emitter {
1
+ import Emitter from 'events'
2
+ import Plugin from 'imdone-api'
3
+ import _path from 'path'
4
+ import { downloadPlugin } from '../adapters/git-download.js'
5
+ import rimraf from 'rimraf'
6
+ import chokidar from 'chokidar'
7
+ import debounce from 'lodash.debounce'
8
+ import { exists, mkdir, readdir } from '../adapters/file-gateway.js'
9
+ import { appContext } from '../context/ApplicationContext.js'
10
+ import { createRequire } from 'node:module';
11
+
12
+ import PersistTagsPlugin from './persist-tags-plugin.js'
13
+ import DefaultBoardPropertiesPlugin from './default-board-properties-plugin.js'
14
+ import DefaultBoardActionsPlugin from './default-board-actions-plugin.js'
15
+ import ArchivePlugin from './archive-plugin.js'
16
+ import EpicPlugin from './epic-plugin.js'
17
+ import ExtensionPlugin from './extension-plugin.js'
18
+ import { logger } from '../adapters/logger.js'
19
+
20
+ const require = createRequire(import.meta.url);
21
+ const url = new URL(import.meta.url)
22
+ const __dirname = _path.dirname(url.pathname)
23
+
24
+ export class PluginManager extends Emitter {
12
25
  constructor(project) {
13
26
  super()
14
27
  this.project = project
15
28
  this.defaultPlugins = [
16
- './persist-tags-plugin',
17
- './default-board-properties-plugin',
18
- './default-board-actions-plugin',
19
- './archive-plugin',
20
- './epic-plugin',
21
- './extension-plugin',
29
+ PersistTagsPlugin,
30
+ DefaultBoardPropertiesPlugin,
31
+ DefaultBoardActionsPlugin,
32
+ ArchivePlugin,
33
+ EpicPlugin,
34
+ ExtensionPlugin,
22
35
  ]
36
+
23
37
  this.pluginsMap = {}
24
38
  this.pluginPath = _path.join(project.path, '.imdone', 'plugins')
25
39
  this.onDevChange = debounce(this.onDevChange.bind(this), 1000)
@@ -29,7 +43,7 @@ module.exports = class PluginManager extends Emitter {
29
43
  if (this.project && this.project.config.devMode && !this.watcher) {
30
44
  if (!(await exists(this.pluginPath)))
31
45
  await mkdir(this.pluginPath)
32
- this.watcher = sane(this.pluginPath, {
46
+ this.watcher = chokidar(this.pluginPath, {
33
47
  ignored(path) {
34
48
  return /node_modules/.test(path)
35
49
  },
@@ -58,7 +72,7 @@ module.exports = class PluginManager extends Emitter {
58
72
  await this.reloadPlugins()
59
73
  this.emit('plugins-reloaded')
60
74
  } catch {
61
- console.error('Error reloading plugins.', err)
75
+ logger.error('Error reloading plugins.', err)
62
76
  throw err
63
77
  }
64
78
  }
@@ -71,7 +85,7 @@ module.exports = class PluginManager extends Emitter {
71
85
 
72
86
  async uninstallPlugin(pluginName) {
73
87
  return new Promise((resolve, reject) => {
74
- console.log('Preparing to uninstall plugin:', pluginName)
88
+ logger.log('Preparing to uninstall plugin:', pluginName)
75
89
  const pluginClassName = Object.keys(this.pluginsMap).find((key) => {
76
90
  return this.getPlugin(key).info.name === pluginName
77
91
  })
@@ -81,7 +95,7 @@ module.exports = class PluginManager extends Emitter {
81
95
  const { info } = this.getPlugin(pluginClassName)
82
96
  const { path } = info
83
97
  // const pkg = { version, name }
84
- console.log('Uninstalling:', info)
98
+ logger.log('Uninstalling:', info)
85
99
 
86
100
  rimraf(path, (err) => {
87
101
  if (err) return reject(err)
@@ -96,15 +110,15 @@ module.exports = class PluginManager extends Emitter {
96
110
  if (!(await exists(this.pluginPath)))
97
111
  await mkdir(this.pluginPath)
98
112
  const installPath = _path.join(this.pluginPath, name)
99
- await downloadRepo(version, installPath)
100
- console.log(`Done installing ${name}`)
113
+ await downloadPlugin(version, installPath)
114
+ logger.log(`Done installing ${name}`)
101
115
  await this.loadPlugin(installPath)
102
116
  this.emit('plugin-installed', name)
103
117
  }
104
118
 
105
119
  async loadPlugins() {
106
- for (const pluginPath of this.defaultPlugins) {
107
- await this.loadPlugin(pluginPath)
120
+ for (const PluginClass of this.defaultPlugins) {
121
+ await this.createPlugin(PluginClass)
108
122
  }
109
123
 
110
124
  await this.loadInstalledPlugins()
@@ -143,40 +157,49 @@ module.exports = class PluginManager extends Emitter {
143
157
  }
144
158
 
145
159
  async loadPlugin(path) {
146
- console.log('Loading plugin: ', path)
160
+ logger.log('Loading plugin: ', path)
161
+ const fullPath = path.endsWith('.js')
162
+ ? _path.resolve(path)
163
+ : _path.join(_path.resolve(path), 'bundle.js')
164
+
147
165
  try {
148
166
  // eslint-disable-next-line
149
- delete require.cache[require.resolve(path)]
167
+ delete require.cache[require.resolve(fullPath)]
150
168
  // eslint-disable-next-line
151
- const pluginClass = require(path)
152
- const pluginInstance = await this.createPlugin(pluginClass, path)
153
- if (pluginInstance.init) await pluginInstance.init()
169
+ const pluginClass = await import(_path.resolve(path))
170
+ const pluginInstance = await this.createPlugin(pluginClass.default, path)
171
+ return pluginInstance
154
172
  } catch (e) {
155
- console.error(`Error loading plugin at: ${path}`, e)
173
+ logger.error(`Error loading plugin at: ${path}`, e)
156
174
  }
157
175
  }
158
176
 
159
- async createPlugin(pluginClass, path) {
160
- if (!this.isPlugin(pluginClass))
161
- throw new Error(`${pluginClass.name} is not a plugin`)
162
- const name = pluginClass.name.toString()
163
- const pluginInstance = new pluginClass(this.project)
164
- let info = {}
177
+ getPackageInfo(path) {
178
+ if (!path) return {}
179
+ let info = { path }
165
180
  try {
166
- info = require(`${path}/package.json`)
181
+ info = {...info, ...require(`${path}/package.json`) }
167
182
  delete info.dependencies
168
183
  delete info.devDependencies
169
184
  delete info.scripts
170
185
  delete info.main
171
186
  } catch (e) {
172
- console.info('No info on plugin:', path)
173
- } finally {
174
- info.path = path
175
- info.name = name
187
+ logger.info('No info on plugin:', path)
188
+ }
189
+ }
190
+
191
+ async createPlugin(pluginClass, path = undefined) {
192
+ if (!this.isPlugin(pluginClass))
193
+ throw new Error(`${pluginClass.name} is not a plugin`)
194
+ const name = pluginClass.name.toString()
195
+ const pluginInstance = new pluginClass(this.project)
196
+ let info = {
197
+ name,
198
+ ...this.getPackageInfo(path),
176
199
  }
177
200
 
178
201
  pluginInstance.getSettings = () => {
179
- return this.getPluginSettings(info.name)
202
+ return this.getPluginSettings(name)
180
203
  }
181
204
 
182
205
  this.pluginsMap[name] = {
@@ -185,6 +208,8 @@ module.exports = class PluginManager extends Emitter {
185
208
  info,
186
209
  }
187
210
 
211
+ if (pluginInstance.init) await pluginInstance.init()
212
+
188
213
  return pluginInstance
189
214
  }
190
215
 
@@ -200,7 +225,15 @@ module.exports = class PluginManager extends Emitter {
200
225
  }
201
226
 
202
227
  isPlugin(pluginClass) {
203
- return Object.getPrototypeOf(pluginClass).name === Plugin.name
228
+ // const pluginClassName = Plugin.name.toString()
229
+ // return pluginClass.proname.toString() === pluginClassName
230
+ const pluginClassPrototypeName = Object.getPrototypeOf(pluginClass.prototype).constructor.name
231
+ const pluginClassName = Plugin.name.toString()
232
+ logger.log('pluginClassPrototypeName', pluginClassPrototypeName)
233
+ logger.log('pluginClassName', pluginClassName)
234
+ return pluginClassPrototypeName === pluginClassName
235
+
236
+ // return Object.getPrototypeOf(pluginClass.prototype) === Plugin.prototype
204
237
  }
205
238
 
206
239
  eachPlugin(cb) {
@@ -227,6 +260,10 @@ module.exports = class PluginManager extends Emitter {
227
260
  })
228
261
  }
229
262
 
263
+ disablePlugin(name) {
264
+ delete this.pluginsMap[name]
265
+ }
266
+
230
267
  getPluginName(pluginInstance) {
231
268
  return Object.keys(this.pluginsMap).find(
232
269
  (pluginName) =>
@@ -249,7 +286,7 @@ module.exports = class PluginManager extends Emitter {
249
286
  }
250
287
 
251
288
  pluginError(method, pluginInstance, error) {
252
- console.warn(
289
+ logger.warn(
253
290
  `Plugin: ${this.getPluginName(
254
291
  pluginInstance
255
292
  )} threw an error on ${method}: `,
@@ -261,13 +298,13 @@ module.exports = class PluginManager extends Emitter {
261
298
  if (!lists || lists.length == 0) return
262
299
  await this.eachPluginAsync(async ({ pluginInstance }) => {
263
300
  // const timeLabel = `${this.getPluginName(pluginInstance)} onBoardUpdate time`
264
- // console.time(timeLabel)
301
+ // logger.time(timeLabel)
265
302
  try {
266
303
  await pluginInstance.onBoardUpdate(lists)
267
304
  } catch (e) {
268
305
  this.pluginError('onBoardUpdate', pluginInstance, e)
269
306
  }
270
- // console.timeEnd(timeLabel)
307
+ // logger.timeEnd(timeLabel)
271
308
  })
272
309
  return lists
273
310
  }
@@ -340,10 +377,7 @@ module.exports = class PluginManager extends Emitter {
340
377
  return cardProps
341
378
  }
342
379
 
343
- // READY Make getBoardProperties async
344
- // <!--
345
- // order:-10
346
- // -->
380
+
347
381
  async getBoardProperties() {
348
382
  let boardProps = {}
349
383
  await this.eachPluginAsync(async ({ pluginInstance }) => {
@@ -409,13 +443,16 @@ module.exports = class PluginManager extends Emitter {
409
443
  }
410
444
 
411
445
  async performBoardAction(action, task) {
446
+ const title = action.title || action.name
412
447
  const plugin = this.getPluginInstance(action.plugin)
413
448
  try {
414
449
  return action.index
415
450
  ? await plugin.getBoardActions()[action.index].action(task)
416
- : await plugin.getBoardActions().find(a => a.title === action.title).action(task)
451
+ : await plugin.getBoardActions().find(a => a.title === title).action(task)
417
452
  } catch (e) {
453
+
418
454
  this.pluginError('getBoardActions', plugin, e)
455
+ throw new Error(`Error performing action ${title} on plugin ${plugin.name}: ${e.message}`)
419
456
  }
420
457
  }
421
458
  }
@@ -1,29 +1,25 @@
1
- const {
1
+ import https from 'https'
2
+ import {
2
3
  renderMarkdown,
3
- } = require('../adapters/markdown')
4
-
5
- module.exports = {
6
-
7
- getAvailablePlugins: async function () {
8
- const response = await fetch('https://raw.githubusercontent.com/imdone/imdone-plugins/main/index.json')
9
- const plugins = response.body
10
- for (const plugin of plugins) {
11
- plugin.content = renderMarkdown(await getReadmeContent(plugin))
12
- }
13
- return plugins
14
- },
4
+ } from '../adapters/markdown.js'
15
5
 
6
+ export async function getAvailablePlugins() {
7
+ const response = await fetch('https://raw.githubusercontent.com/imdone/imdone-plugins/main/index.json')
8
+ const plugins = response.body
9
+ for (const plugin of plugins) {
10
+ plugin.content = renderMarkdown(await getReadmeContent(plugin))
11
+ }
12
+ return plugins
16
13
  }
17
14
 
18
15
  async function getReadmeContent({version}) {
19
16
  const response = await fetch(`https://api.github.com/repos/${version}/readme`)
20
- const { content } = response.body
17
+ const { content } = response?.body
18
+ if (!content) return ''
21
19
  const buffer = Buffer.from(content, 'base64');
22
20
  return buffer.toString('utf-8');
23
21
  }
24
22
 
25
- const https = require('https')
26
-
27
23
  async function fetch(url, opts = { method: 'GET', headers: {} }) {
28
24
  const { method, headers, body, debug = () => { } } = opts
29
25
  if (body) headers['Content-Length'] = body.length
@@ -1,20 +1,21 @@
1
- const Repository = require('./repository')
2
- const watchedFsStore = require('./mixins/repo-watched-fs-store')
3
- const fsStore = require('./mixins/repo-fs-store')
4
- const ProjectContext = require('./ProjectContext')
5
- const Project = require('./project')
6
- const context = require('./context/ApplicationContext')
1
+ import { Repository } from './repository.js'
2
+ import { watchedFileSystemStoreMixin } from './mixins/repo-watched-fs-store.js'
3
+ import { fileSystemStoreMixin } from './mixins/repo-fs-store.js'
4
+ import { ProjectContext } from './ProjectContext.js'
5
+ import { WorkerProject } from './project.js'
6
+ import { appContext as context } from './context/ApplicationContext.js'
7
+ import _path from 'node:path'
7
8
 
8
- function createFileSystemProject({
9
+ export function createFileSystemProject({
9
10
  path,
10
11
  config,
11
- repo = fsStore(new Repository(path, config)),
12
+ repo = fileSystemStoreMixin(new Repository(_path.resolve(path), config)),
12
13
  loadInstalledPlugins,
13
14
  loadPluginsNotInstalled
14
15
  }) {
15
16
  context().repo = repo
16
17
  context().projectContext = new ProjectContext(repo)
17
- context().project = new Project(repo)
18
+ context().project = new WorkerProject(repo)
18
19
  if (loadInstalledPlugins) {
19
20
  context().project.pluginManager.loadInstalledPlugins = loadInstalledPlugins
20
21
  }
@@ -24,22 +25,18 @@ function createFileSystemProject({
24
25
  return context().project
25
26
  }
26
27
 
27
- module.exports = {
28
- createWatchedFileSystemProject: function({
28
+ export function createWatchedFileSystemProject({
29
+ path,
30
+ config,
31
+ repo = watchedFileSystemStoreMixin(new Repository(_path.resolve(path), config)),
32
+ loadInstalledPlugins,
33
+ loadPluginsNotInstalled
34
+ }) {
35
+ return createFileSystemProject({
29
36
  path,
30
37
  config,
31
- repo = watchedFsStore(new Repository(path, config)),
38
+ repo,
32
39
  loadInstalledPlugins,
33
- loadPluginsNotInstalled
34
- }) {
35
- return createFileSystemProject({
36
- path,
37
- config,
38
- repo,
39
- loadInstalledPlugins,
40
- loadPluginsNotInstalled
41
- })
42
- },
43
-
44
- createFileSystemProject
40
+ loadPluginsNotInstalled
41
+ })
45
42
  }