diff --git a/.gitmodules b/.gitmodules index 65d0877..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "src/frontend/dashboard"] - path = src/frontend/dashboard - url = https://gitea.frontblock.me/fb-vendor/dashboard.git diff --git a/package.json b/package.json index 3a8fd04..a712471 100644 --- a/package.json +++ b/package.json @@ -5,14 +5,14 @@ "scripts": { "tsc": "tsc", "start": "npm run build; node lib/FrontblockAdmin.js", - "build": "npm run clean; npm run build-backend;", + "build": "npm run clean; npm run build-backend; npm run webpack", "build-backend": "tsc; webpack --display-error-details --config src/backend/webpack.prod.js --progress --colors;", "build-frontend": "npm run build-dashboard", "build-dashboard": "git submodule init && git submodule update --merge; cd src/frontend/dashboard; npm i && npm run build; cp -r dist/* ../../../static", "build-widget": "rollup -c src/frontend/widget/rollup.config.js; mkdir -p plugins/PluginManager; cp FrontendPlugin.js plugins/PluginManager", "clean": "rm -rf lib static plugins data conf dist widget .rpt2_cache *.js *.ts src/frontend/dashboard/dist", "update-frontblock": "rm -rf node_modules/frontblock*; npm install", - "webpack": "webpack --entry ./lib/FrontblockLib.js --output ./FrontblockLib.min.js" + "webpack": "webpack --mode production --entry ./lib/FrontblockLib.js --output ./lib/FrontblockLib.js" }, "repository": { "type": "git", diff --git a/src/backend/FrontblockAdmin.ts b/src/backend/FrontblockAdmin.ts index 713e44d..4108211 100644 --- a/src/backend/FrontblockAdmin.ts +++ b/src/backend/FrontblockAdmin.ts @@ -82,6 +82,10 @@ export class FrontblockAdmin extends ConfigLoader{ return {httpPort: 8080} } + private async updateFrontblockLib(){ + await (new FrontblockCherryPicker("fb-dist/admin", "master", "FrontblockLib.js")).write("./static/FrontblockLib.js") + } + private async updateDashboard(){ const dashboard = new GitUpdater("./static") const status = await dashboard.cloneRepo("https://gitea.frontblock.me/fb-dist/dashboard.git", true) @@ -96,6 +100,7 @@ export class FrontblockAdmin extends ConfigLoader{ private async initialize(){ await this.updateDashboard() + await this.updateFrontblockLib() await this.updatePluginmanager() let str = "../plugins/PluginManager/Plugin" diff --git a/src/frontend/dashboard b/src/frontend/dashboard deleted file mode 160000 index 73c9c97..0000000 --- a/src/frontend/dashboard +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 73c9c973f841e6b49745f3e9eb187397215a0dbf