imdone-core 1.53.10 → 1.53.12

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.
@@ -138,6 +138,7 @@ function resolveFileUrl(src, filePath) {
138
138
  const srcDir = dirname(filePath);
139
139
  const srcPath = resolve(srcDir, src) // filePath ? path.join(filePath, src) : path.resolve(src);
140
140
  const srcUrl = pathToFileURL(srcPath);
141
+ if (src.endsWith('/')) return srcUrl + '/';
141
142
 
142
143
  return srcUrl;
143
144
 
@@ -16,7 +16,8 @@ function format(content, data, mustache) {
16
16
  try {
17
17
  content = template(content, opts)(data)
18
18
  } catch (e) {
19
- content = content.replace(opts.interpolate, `~~\${${e}}~~`)
19
+ console.error(e)
20
+ // content = content.replace(opts.interpolate, `~~\${${e}}~~`)
20
21
  }
21
22
 
22
23
  if (mustache) {
@@ -24,6 +25,7 @@ function format(content, data, mustache) {
24
25
  try {
25
26
  content = template(content, opts)(data)
26
27
  } catch (e) {
28
+ console.error(e)
27
29
  content = content.replace(opts.interpolate, `~~{{${e}}}~~`)
28
30
  }
29
31
  }
@@ -7,6 +7,7 @@ module.exports = class DefaultBoardActionsPlugin extends Plugin {
7
7
 
8
8
  getBoardActions() {
9
9
  const project = this.project
10
+ const isWindows = process.platform === 'win32'
10
11
 
11
12
  return [
12
13
  {
@@ -40,6 +41,14 @@ module.exports = class DefaultBoardActionsPlugin extends Plugin {
40
41
  return project.copyToClipboard(title, `"${title}" copied to clipboard`)
41
42
  },
42
43
  },
44
+ {
45
+ title: `Open in ${isWindows ? 'Explorer' : 'Finder'}`,
46
+ keys: ['alt+shift+o'],
47
+ icon: "folder",
48
+ async action () {
49
+ await project.openPath(project.path)
50
+ }
51
+ }
43
52
  ]
44
53
  }
45
54
 
@@ -22,7 +22,6 @@ module.exports = class PluginManager extends Emitter {
22
22
  this.pluginsMap = {}
23
23
  this.pluginPath = _path.join(project.path, '.imdone', 'plugins')
24
24
  this.onDevChange = debounce(this.onDevChange.bind(this), 1000)
25
- this.loadPlugins()
26
25
  }
27
26
 
28
27
  async startDevMode() {
package/lib/project.js CHANGED
@@ -57,21 +57,26 @@ module.exports = class WorkerProject extends Project {
57
57
  }
58
58
 
59
59
  init(cb) {
60
- this.repo.project = this
61
-
62
- this.pluginManager = new PluginManager(this)
63
- this.pluginManager.on('plugin-installed', () => this.emitUpdate())
64
- this.pluginManager.on('plugin-uninstalled', () => this.emitUpdate())
65
- this.pluginManager.on('plugins-reloaded', () => this.emitUpdate())
66
-
67
- EVENTS.forEach((event) => {
68
- this.repo.on(event, (data) => onChange(this, event, data))
69
- })
70
-
71
- this.repo.on('task.found', (task) => this.pluginManager.onTaskFound(task))
60
+ const promise = new Promise(async (resolve, reject) => {
61
+ this.repo.project = this
62
+
63
+ this.pluginManager = new PluginManager(this)
64
+ this.pluginManager.on('plugin-installed', () => this.emitUpdate())
65
+ this.pluginManager.on('plugin-uninstalled', () => this.emitUpdate())
66
+ this.pluginManager.on('plugins-reloaded', () => this.emitUpdate())
67
+ await this.pluginManager.loadPlugins()
68
+ this.data = this.pluginManager.getBoardProperties()
69
+ this.dataKeys = this.getDataKeys(this.data)
70
+
71
+ console.log('data', this.data)
72
+ console.log('dataKeys', this.dataKeys)
73
+ EVENTS.forEach((event) => {
74
+ this.repo.on(event, (data) => onChange(this, event, data))
75
+ })
76
+
77
+ this.repo.on('task.found', (task) => this.pluginManager.onTaskFound(task))
72
78
 
73
- const promise = new Promise((resolve, reject) => {
74
- this.repo.init((err, files) => {
79
+ this.repo.init(async (err, files) => {
75
80
  if (err) {
76
81
  if (cb) cb(err)
77
82
  else reject(err)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imdone-core",
3
- "version": "1.53.10",
3
+ "version": "1.53.12",
4
4
  "description": "imdone-core",
5
5
  "main": "index.js",
6
6
  "scripts": {