lowcode-engine
lowcode-engine copied to clipboard
使用自定义出码功能出现问题
Describe the bug (required) / 详细描述 bug(必填)
A clear and concise description of what the bug is. / 请提供清晰且精确的 bug 描述
项目初始化之后执行 npm run dev 时会出现报错,报错信息如下:
尝试全局安装 build-scripts 后依然如此
To Reproduce (required) / 如何复现 bug?(必填,非常重要)
Steps to reproduce the behavior: / 详细复现步骤: 1、执行 npx @alilc/lowcode-code-generator init-solution demo 初始化项目。 2、tnpm ii 全局安装依赖包 3、执行 npm run dev 即可复现报错。
Expected behavior (required) / 预期行为(必填,非常重要)
A clear and concise description of what did you expect to happen. / 请清晰和精确的描述你预期的行为 项目可以正常run起来
Screenshots (optional) / bug 截图(可选)
Sceenshots for further information. (If applicable.) / 一些有用的截图将会帮助我们更好的明确以及定位问题

Environments (please complete the following information) (required): / 请提供如下信息(必填)
- AliLowCodeEngine version: [e.g. 1.0.0] / 低代码引擎版本
- AliLowCodeEngineExt version: [e.g. 1.0.0] / 低代码引擎扩展包版本
- Browser [e.g. chrome, safari] / 浏览器版本
- materials / plugins / tools / 其他物料 / 插件 / 工具链版本 - 本地node版本:v16.18.0
(this information can be collected via the manual plugin / 版本信息可通过低代码用户手册插件收集)
Additional context (optional) / 更多额外信息(可选)
Any other context of the problem here. / 可以追加更多的额外信息,帮助定位问题
调试本地的 solution:
node ~/workspace/github-lowcode/lowcode-engine/modules/code-generator/bin/lowcode-code-generator.js generate -i uipaas-comp-pivot.json -o generated-uipaas-comp -s ~/workspace/code-generator-buddies/uipaas-component-solution
参考写一下,直接在 solution start 应该是没啥用的~
或者用更灵活的代码形式:
import { join } from 'path';
import CodeGenerator from '@alilc/lowcode-code-generator';
import createXxxProjectBuilder from 'your-custom-solution'; // 参考 [icejs3](https://github.com/alibaba/lowcode-engine/blob/7879a63638d54038001186d8a9b9b77bcf24a290/modules/code-generator/src/solutions/icejs3.ts#L28)
import schema from './example-schema.json';
async function exportProject() {
const project = await createXxxProjectBuilder().generateProject(
schema, // 编排搭建出来的 schema
);
// 写入磁盘
await CodeGenerator.publishers.disk().publish({
project, // 上一步生成的 project
outputPath: join(__dirname, '../../output'), // 输出目录
projectSlug: 'example-json', // 项目标识
});
}
exportProject();