Skip to content

Commit 9e86450

Browse files
committed
feat: add global plugins file to the newly created app
1 parent 22d1f65 commit 9e86450

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const globalPlugins = []

adminforth/commands/createApp/templates/index.ts.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import path from 'path';
66
import { Filters } from 'adminforth';
77
import { initApi } from './api.js';
88
import { logger } from 'adminforth';
9+
import { globalPlugins } from './globalPlugins.js';
910

1011
const ADMIN_BASE_URL = '';
1112

@@ -65,6 +66,7 @@ export const admin = new AdminForth({
6566
resourceId: 'adminuser'
6667
}
6768
],
69+
globalPlugins: globalPlugins,
6870
});
6971

7072
if (fileURLToPath(import.meta.url) === path.resolve(process.argv[1])) {

adminforth/commands/createApp/utils.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,11 @@ async function writeTemplateFiles(dirname, cwd, useNpm, options) {
355355
src: 'custom/package.json.hbs',
356356
dest: 'custom/package.json',
357357
data: {}
358+
},
359+
{
360+
src: 'globalPlugins.ts.hbs',
361+
dest: 'globalPlugins.ts',
362+
data: {},
358363
}
359364
];
360365

0 commit comments

Comments
 (0)