From 192ebf18594bf61af492b005d9f41ac187f772c2 Mon Sep 17 00:00:00 2001 From: Xc Date: Thu, 21 Dec 2023 11:19:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86makeAppDomain?= =?UTF-8?q?=EF=BC=8C=E4=BB=8EoakExteralLib=E4=B8=AD=E8=AF=BB=E5=87=BA?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E7=9A=84=E5=BA=93=EF=BC=8C=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E4=BA=86=E6=A8=A1=E6=9D=BF=E7=9A=84index.html=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E4=BE=9D=E8=B5=96unpkg.com?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/make-app-domain.js | 19 ++- template/web/public/index.html | 235 +++++++++++++++++++++++++++------ 2 files changed, 210 insertions(+), 44 deletions(-) diff --git a/scripts/make-app-domain.js b/scripts/make-app-domain.js index 397bc8d..705fe30 100644 --- a/scripts/make-app-domain.js +++ b/scripts/make-app-domain.js @@ -1,10 +1,23 @@ const { existsSync } = require('fs'); +const { removeSync } = require('fs-extra'); +const { join } = require('path'); const { buildSchema, analyzeEntities, } = require(`${process.cwd()}/node_modules/oak-domain/lib/compiler/schemalBuilder`); +// todo,这里还是很奇怪,要把src/entites的依赖给去掉 analyzeEntities(`${process.cwd()}/node_modules/oak-domain/src/entities`, 'oak-domain/lib/entities'); -analyzeEntities(`${process.cwd()}/node_modules/oak-general-business/src/entities`, 'oak-general-business/lib/entities'); -analyzeEntities(`${process.cwd()}/src/entities`); -buildSchema(`${process.cwd()}/src/oak-app-domain`); \ No newline at end of file +// 从config中读出相应依赖 +const externalLibFile = join(process.cwd(), 'src', 'config', 'oakExternalLib.json'); +if (existsSync(externalLibFile)) { + const exteralLibs = require(externalLibFile); + exteralLibs.forEach( + (ele) => { + analyzeEntities(`${process.cwd()}/node_modules/${ele}/src/entities`, `${ele}/lib/entities`); + } + ); +} +analyzeEntities(join(process.cwd(), 'src', 'entities')); +removeSync(join(process.cwd(), 'src', 'oak-app-domain')); +buildSchema(join(process.cwd(), 'src', 'oak-app-domain')); \ No newline at end of file diff --git a/template/web/public/index.html b/template/web/public/index.html index 5429c50..1197a78 100644 --- a/template/web/public/index.html +++ b/template/web/public/index.html @@ -1,38 +1,83 @@ - - - - - - - - - - - - - - - - - - - + - - - - - - - - + + + - oak template project - - + oak template project + + - - + + - - -
- - + --> - \ No newline at end of file + +