Skip to content

Commit 6cc3554

Browse files
authored
Merge pull request #363 from devforth/AdminForth/828
feat: add ability for plugins to register custom components
2 parents 3d70ad1 + 873658f commit 6cc3554

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

adminforth/modules/codeInjector.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ class CodeInjector implements ICodeInjector {
8585
return path.join(TMP_DIR, 'adminforth', brandSlug, 'spa_tmp');
8686
}
8787

88+
registerCustomComponent(filePath: string): void {
89+
const componentName = getComponentNameFromPath(filePath);
90+
this.allComponentNames[filePath] = componentName;
91+
}
92+
8893
cleanup() {
8994
console.log('Cleaning up...');
9095
this.allWatchers.forEach((watcher) => {

adminforth/types/Back.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export interface ICodeInjector {
2222
devServerPort: number;
2323

2424
getServeDir(): string;
25-
25+
registerCustomComponent(filePath: string): void;
2626
spaTmpPath(): string;
2727
}
2828

0 commit comments

Comments
 (0)