imdone-core 2.0.9 → 2.0.11
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/.husky/pre-commit +7 -0
- package/CHANGELOG.md +6 -0
- package/lib/adapters/storage/config.js +1 -0
- package/lib/plugins/archive-plugin.js +4 -0
- package/lib/plugins/default-board-actions-plugin.js +4 -0
- package/lib/plugins/default-board-properties-plugin.js +4 -0
- package/lib/plugins/epic-plugin.js +4 -0
- package/lib/plugins/extension-plugin.js +4 -0
- package/lib/plugins/persist-tags-plugin.js +4 -0
- package/lib/plugins/plugin-manager.js +4 -14
- package/package.json +8 -4
- package/types/plugins/archive-plugin.d.ts +1 -0
- package/types/plugins/default-board-actions-plugin.d.ts +1 -0
- package/types/plugins/default-board-properties-plugin.d.ts +1 -0
- package/types/plugins/epic-plugin.d.ts +1 -0
- package/types/plugins/extension-plugin.d.ts +1 -0
- package/types/plugins/persist-tags-plugin.d.ts +1 -0
- package/types/plugins/plugin-manager.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,7 @@ import { Config } from '../../config.js'
|
|
|
7
7
|
import { logger } from '../logger.js'
|
|
8
8
|
|
|
9
9
|
const { CONFIG_DIR, CONFIG_FILE_YML } = constants
|
|
10
|
+
|
|
10
11
|
export async function load(projectPath, configPath = _path.join(projectPath, CONFIG_FILE_YML)) {
|
|
11
12
|
const configLike = await loadYamlConfig(configPath)
|
|
12
13
|
return configLike && new Config(configLike)
|
|
@@ -5,6 +5,10 @@ export default class DefaultBoardActionsPlugin extends Plugin {
|
|
|
5
5
|
super(project)
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
static get pluginName() {
|
|
9
|
+
return 'DefaultBoardActionsPlugin'
|
|
10
|
+
}
|
|
11
|
+
|
|
8
12
|
getBoardActions() {
|
|
9
13
|
const project = this.project
|
|
10
14
|
const isWindows = process.platform === 'win32'
|
|
@@ -19,6 +19,10 @@ export default class DefaultBoardPropertiesPlugin extends Plugin {
|
|
|
19
19
|
this.templates = {}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
static get pluginName() {
|
|
23
|
+
return 'DefaultBoardPropertiesPlugin'
|
|
24
|
+
}
|
|
25
|
+
|
|
22
26
|
async onBeforeBoardUpdate() {
|
|
23
27
|
this.templates = await this.getTemplates()
|
|
24
28
|
}
|
|
@@ -13,6 +13,10 @@ export default class ExtensionPlugin extends Plugin {
|
|
|
13
13
|
this.configDir = _path.join(project.path, '.imdone')
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
static get pluginName() {
|
|
17
|
+
return 'ExtensionPlugin'
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
async init() {
|
|
17
21
|
this.cardActionsFunction = await this.loadExtensionModule(
|
|
18
22
|
() => [],
|
|
@@ -184,9 +184,11 @@ export class PluginManager extends Emitter {
|
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
async createPlugin(pluginClass, path = undefined) {
|
|
187
|
-
|
|
187
|
+
const name = pluginClass.pluginName
|
|
188
|
+
if (!name) {
|
|
188
189
|
throw new Error(`${pluginClass.name} is not a plugin`)
|
|
189
|
-
|
|
190
|
+
}
|
|
191
|
+
|
|
190
192
|
const pluginInstance = new pluginClass(this.project)
|
|
191
193
|
const packageInfo = await this.getPackageInfo(path)
|
|
192
194
|
let info = {
|
|
@@ -220,18 +222,6 @@ export class PluginManager extends Emitter {
|
|
|
220
222
|
})
|
|
221
223
|
}
|
|
222
224
|
|
|
223
|
-
isPlugin(pluginClass) {
|
|
224
|
-
// const pluginClassName = Plugin.name.toString()
|
|
225
|
-
// return pluginClass.proname.toString() === pluginClassName
|
|
226
|
-
const pluginClassPrototypeName = Object.getPrototypeOf(pluginClass.prototype).constructor.name
|
|
227
|
-
const pluginClassName = Plugin.name.toString()
|
|
228
|
-
logger.log('pluginClassPrototypeName', pluginClassPrototypeName)
|
|
229
|
-
logger.log('pluginClassName', pluginClassName)
|
|
230
|
-
return pluginClassPrototypeName === pluginClassName
|
|
231
|
-
|
|
232
|
-
// return Object.getPrototypeOf(pluginClass.prototype) === Plugin.prototype
|
|
233
|
-
}
|
|
234
|
-
|
|
235
225
|
eachPlugin(cb) {
|
|
236
226
|
Object.keys(this.pluginsMap).forEach((key) => {
|
|
237
227
|
cb(this.getPlugin(key))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "imdone-core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.11",
|
|
4
4
|
"description": "imdone-core",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,15 +14,18 @@
|
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
16
|
"prepublishOnly": "npm run build",
|
|
17
|
-
"build": "npm run
|
|
17
|
+
"build": "npm run pre-commit && npm run coverage",
|
|
18
18
|
"build:docs": "doctoc --github --notitle README.md",
|
|
19
19
|
"build:docs:index": "node scripts/index-markdown.js",
|
|
20
20
|
"build:index": "node scripts/generate-index.js",
|
|
21
21
|
"build:types": "tsc --noEmit false",
|
|
22
22
|
"coverage": "vitest --run --coverage",
|
|
23
|
+
"link": "npm link ../imdone-api",
|
|
24
|
+
"pre-commit": "npm run build:docs && npm run build:docs:index && npm run build:index && npm run build:types",
|
|
23
25
|
"test": "vitest --run",
|
|
24
26
|
"test-ci": "vitest --run",
|
|
25
|
-
"serve": "npx docsify-cli serve"
|
|
27
|
+
"serve": "npx docsify-cli serve",
|
|
28
|
+
"prepare": "husky"
|
|
26
29
|
},
|
|
27
30
|
"keywords": [
|
|
28
31
|
"imdone",
|
|
@@ -55,7 +58,7 @@
|
|
|
55
58
|
"find-up-simple": "^1.0.1",
|
|
56
59
|
"gray-matter": "^4.0.2",
|
|
57
60
|
"ignore": "^5.2.0",
|
|
58
|
-
"imdone-api": "^2.0.
|
|
61
|
+
"imdone-api": "^2.0.1",
|
|
59
62
|
"isbinaryfile": "^5.0.4",
|
|
60
63
|
"js-yaml": "^3.14.1",
|
|
61
64
|
"json-fns": "^1.0.0",
|
|
@@ -107,6 +110,7 @@
|
|
|
107
110
|
"esbuild": "^0.25.1",
|
|
108
111
|
"expect.js": "~0.3.1",
|
|
109
112
|
"fs-extra": "^11.1.0",
|
|
113
|
+
"husky": "^9.1.7",
|
|
110
114
|
"json-stringify-safe": "~5.0.0",
|
|
111
115
|
"prettier": "^2.5.1",
|
|
112
116
|
"typescript": "^5.8.2",
|
|
@@ -22,7 +22,6 @@ export class PluginManager extends Emitter<[never]> {
|
|
|
22
22
|
getPackageInfo(path: any): Promise<{} | undefined>;
|
|
23
23
|
createPlugin(pluginClass: any, path?: undefined): Promise<any>;
|
|
24
24
|
destroyPlugins(): void;
|
|
25
|
-
isPlugin(pluginClass: any): boolean;
|
|
26
25
|
eachPlugin(cb: any): void;
|
|
27
26
|
eachPluginAsync(cb: any): Promise<void>;
|
|
28
27
|
getPlugins(): any[];
|