tiny-engine/scripts/buildMaterials.mjs

203 lines
5.3 KiB
JavaScript
Raw Permalink Normal View History

feat: 增加物料TinyEcharts和TinyTransitions (#478) * init project Match-id-61778b743a9dc8d8df471dcb285fb229931648a6 * fix: fix build error (#1) * fix: fix build error * fix: fix server dependence * fix: add logo and fix readme (#5) * update readme (#6) * fix: add logo and fix readme * fix: update readme * feat: add pnpm to project * fix(bundle): fix env variable can not be bundle (#16) * docs: add pr and bug template (#18) * fix(bindEvents): fix bind Events can not delete (#22) * feat: 修复当画布没有内容时控制台报错 (#26) * fix:按钮组数据编辑后显示出错 (#24) * fix:走马灯属性配置清空标签页后添加标签页显示出错 (#23) * fix:走马灯属性配置清空标签页后添加标签页显示出错 * fix: 优化走马灯删除标签页问题修复方案 * fix(design-core): build error with monaco-editor (#57) * fix(page-lock):页面解锁按钮图标修复 (#43) * fix: 修复无页面时页面内容显示错误问题 (#31) * fix: 修复不切换页面点击页面设置时表单校验错误问题 (#32) * fix(block-list-icon):区块管理面板去掉列表图标 (#33) * fix:区块管理面板去掉列表图标 * fix(block-list-icon):区块管理面板去掉列表图标 * feat(docs): add Milestones (#46) * feat(chore): update package info (#53) * feat(chore): update package info * feat(docs-package): add homepage url * fix(toolbars): disable toolbar btn when page is empty (#70) * fix(toolbars): disable toolbar btn when page is empty * fix(toolbar): disable preview when page is empty * feat(doc): add doc link to readme (#54) * fix(style): adjust style detail (#67) * fix(canvas): change canvas menu item hiding to disabed (#75) * fix(canvas): fix del key error when nothing is selected (#69) * feat(chore): add setup script setup environment before serving (#80) * fix(pluginMaterial): fix block list can't scroll when visible in canvas (#77) * feat: 页面输入输出配置,配置内有内容时,按钮替换为展示部分文案内容。 (#66) * feat: 页面输入输出配置,配置内有内容时,按钮替换为展示部分文案内容。 * feat: 方法名修改更加符合语义 * fix:修复属性面板-插槽开关切换schema不正确 (#85) * fix:时间线步骤条编辑数据,步骤条会消失 (#84) * fix: 时间线步骤条编辑data,时间线会消失 * Revert "fix: 时间线步骤条编辑data,时间线会消失" This reverts commit b24f8ba60d9bdf42ec74cfdedd57a2bfcf7d63ba. * fix:时间线步骤条编辑数据,时间线会消失 * fix(pagePlugin): 删除文件夹添加节流,避免多次出现无法删除弹窗 (#74) * fix(pagePlugin): 删除文件夹添加防抖,避免多次出现无法删除弹窗 * fix(pagePlugin): use throttle by review comment * fix:loading can't be closed when state is saved (#87) * fix:loading can't be closed when state is saved * fix: remove global loading * fix(metaComponent): fix #79 metaListItems dragging not working (#86) * fix(pagePlugin): clear some state when delte current page (#72) * fix(pagePlugin): clear some state when delte current page * fix(pagePlugin): del unnecessary optional chaining operator * fix(chore): add code readablity * fix(chore): optimize code by review comment * fix: 数据源面板中,点击新建字段报错 (#37) * fix:修复组件属性绑定工具类函数,出码预览未定义 (#90) * fix(insert-footer-button):设计器页面设置-输入设置中,保存取消按钮顺序错误,格式化按钮样式错误,应与UI保持一直;大纲书导航中,眼睛图标,建议改为睁开就是可见,闭眼就是不可见;提示框样式修改 (#94) * fix(insert-footer-button): 设计器页面设置-输入设置中,保存取消按钮顺序错误,格式化按钮样式错误,应与UI保持一致; 大纲树导航中,眼睛图标,建议改为睁开就是可见,闭眼就是不可见; 提示框样式修改 * fix(styles-import): 解决tree组件选中样式背景色为黑色的问题 (#102) * feat(builtin): builtinComponent 组件独立包抽离 (#52) * feat(builtin): builtinComponent 组件独立包抽离 * 添加eslint&自动化构建 (#101) * fix:组件属性绑定工具类utils,修改预览出码实现 (#93) * fix: 修复空页面执行右键删除和右键复制时控制台报错的问题 (#103) * fix: 修复空页面执行右键删除和右键复制时控制台报错的问题 * fix: 修复空页面执行右建操作时控制台报错的问题 * refactor: 简化operations空判断代码 * fix: verify operations copy id * fix: verify operations copy id * fix: verify operations copy id * fix: copyNode function verify params * fix: 不可操作的菜单项disabled * fix: 点击disabled菜单项 不关闭菜单 * fix:修复自定义属性新增功能 (#108) * fix:修复自定义属性新增功能 * fix: 修复MetaHtmlText组件控制台警告 * fix:调整透传Attributes警告解决方案 * fix:调整透传Attributes警告解决方案 * fix:调整透传Attributes警告解决方案 * fix(canvasShortCutPanel): add click event to quick insert component in… (#81) * fix(canvasShotCutPanel): add click event to quick insert component in shortcutpanel * fix(canvasShortPanel): add deepclone utils * feat(utils): add deepClone method * feat(unit-test): add unit test for deepclone function * fix: code check (#112) * fix: code check (#117) * fix: 变量修改后保存页面,再次修改变量失败 (#110) * fix:修复国际化参数配置 (#106) * feat(style): stylePanel add style selector, write css to global styles (#41) * feat(style): stylePanel add style selector, write css to global styles * feat(style): classNameSelector support edit and delete * fix(build): fix setting-style plugin build error * fix(chore): fix review comment * fix: 修复DSL出码报错 (#139) * fix(plugin-script): js plugin code format when save (#138) * fix: 手动更新画布key导致表格渲染出错 (#129) * fix(dataSources): 解决collection添加表格时预览报错 #118 (#151) * feat(block2webcomponent): add block2webcomponent package (#146) * feat(block2webcomponent): add block2webcomponent package * fix(build): fix build config uncorrect * fix(build): change cdn link to npmmirror * fix:删除lowcodeWrap多余参数 (#119) * fix(chore): replace unpkg with npmmirror (#149) * fix(chore): replace unpkg with npmmirror * fix(dev): dev environment use node_moduels * fix(chore): sync version * fix(preview): use npmmirror link * fix(preview): devtoolapi use unpkg link * fix(preview): import map add esm cdn * fix(version): fix tiny-vue version * fix(version): fix tiny-vue version * fix(version): fix tiny-vue version * fix(blockBuild): change packageName to block build (#160) * fix: 画布中右键弹框,修复添加父级-弹出框功能 (#60) * fix: 画布中右键弹框,修复添加父级-弹出框功能 * fix: schema缺少children * fix: 按检视意见修改 * fix: 修复画布宽度设置问题 (#128) * fix: 修复画布宽度设置问题 * fix: 修复复制静态文件时接口报错 (#175) * feat:引入第三方组件库element-plus部分组件示例 (#105) * feat: 引入第三方组件库element-plus示例 * fix:修复格式错误 * feat:表格列配置组件 * feat:增加表格列配置组件 * fix:build error * fix:修复scheme2code接口报错 * fix:修改import顺序 * fix: 使用import动态导入有cdn的工具类 (#133) * fix: 使用import动态导入有cdn的工具类 * fix(preview): upgrade vue repl version (#170) * fix(preview): upgrade vue repl version * fix(preview): optimized by review comment * fix:添加style变量赋值 (#154) * fix: 修复unpkg依赖 (#188) * fix: 修复unpkg依赖 * fix:固定opentiny/vue的次版本号 * fix:升级devtools-api版本 * fix:CDN域名提取环境变量 * fix:升级opentiny/vue版本 * fix:修改主题样式文件版本 * fix:修复codeCheck * feat:设计器增加帮助文档说明 (#100) * fix: 修复多个全局变量下载代码出错 (#197) * fix: 修复多个全局变量下载代码出错 * fix: 精简应用发布时commit消息的校验规则 (#205) * feat: 开放区块管理相关功能 (#206) * feat: add materials script (#195) 增加拆分物料与构建物料脚本 * doc:README添加物料同步脚本说明 (#207) * feat(generate-vue): change generate vue code location (#201) * feat(generate-vue): change generate vue code location * fix(generate-vue): fix generate route did not export * feat(docs): 增加跟本地后端直连的方案 (#208) * docs(readme): 增加后端的启动描述 * feat(chore): change dependencies type to workspace:* (#216) * chore: add code review action (#215) * chore(release): publish (#219) * chore(release): publish - @opentiny/tiny-engine-mock@1.0.1 - @opentiny/tiny-engine-block-build@1.0.0 - @opentiny/tiny-engine-builtin-component@1.0.0 - @opentiny/tiny-engine-canvas@1.0.1 - @opentiny/tiny-engine-common@1.0.1 - @opentiny/tiny-engine-controller@1.0.1 - @opentiny/tiny-engine@1.0.0-beta.2 - @opentiny/tiny-engine-http@1.0.1 - @opentiny/tiny-engine-i18n-host@1.0.1 - @opentiny/tiny-engine-plugin-block@1.0.2 - @opentiny/tiny-engine-plugin-bridge@1.0.2 - @opentiny/tiny-engine-plugin-data@1.0.2 - @opentiny/tiny-engine-plugin-datasource@1.0.2 - @opentiny/tiny-engine-plugin-help@1.0.2 - @opentiny/tiny-engine-plugin-i18n@1.0.2 - @opentiny/tiny-engine-plugin-materials@1.0.2 - @opentiny/tiny-engine-plugin-page@1.0.2 - @opentiny/tiny-engine-plugin-robot@1.0.2 - @opentiny/tiny-engine-plugin-schema@1.0.2 - @opentiny/tiny-engine-plugin-script@1.0.2 - @opentiny/tiny-engine-plugin-tree@1.0.2 - @opentiny/tiny-engine-plugin-tutorial@1.0.2 - @opentiny/tiny-engine-setting-design@1.0.2 - @opentiny/tiny-engine-setting-events@1.0.2 - @opentiny/tiny-engine-setting-props@1.0.2 - @opentiny/tiny-engine-setting-styles@1.0.2 - @opentiny/tiny-engine-svgs@1.0.2 - @opentiny/tiny-engine-theme-dark@1.0.2 - @opentiny/tiny-engine-theme-light@1.0.3 - @opentiny/tiny-engine-toolbar-breadcrumb@1.0.2 - @opentiny/tiny-engine-toolbar-clean@1.0.2 - @opentiny/tiny-engine-toolbar-collaboration@1.0.2 - @opentiny/tiny-engine-toolbar-fullscreen@1.0.2 - @opentiny/tiny-engine-toolbar-generate-vue@1.0.2 - @opentiny/tiny-engine-toolbar-lang@1.0.2 - @opentiny/tiny-engine-toolbar-layout@1.0.2 - @opentiny/tiny-engine-toolbar-checkinout@1.0.2 - @opentiny/tiny-engine-toolbar-logo@1.0.2 - @opentiny/tiny-engine-toolbar-logout@1.0.2 - @opentiny/tiny-engine-toolbar-media@1.0.2 - @opentiny/tiny-engine-toolbar-preview@1.0.2 - @opentiny/tiny-engine-toolbar-redoundo@1.0.2 - @opentiny/tiny-engine-toolbar-refresh@1.0.2 - @opentiny/tiny-engine-toolbar-save@1.0.2 - @opentiny/tiny-engine-toolbar-setting@1.0.2 - @opentiny/tiny-engine-utils@1.0.2 - @opentiny/tiny-engine-dsl-vue@1.0.2 - @opentiny/tiny-engine-webcomponent-core@1.0.2 * chore(release): publish - @opentiny/tiny-engine-mock@1.0.2 - @opentiny/tiny-engine-block-build@1.0.1 - @opentiny/tiny-engine-builtin-component@1.0.0 - @opentiny/tiny-engine-canvas@1.0.2 - @opentiny/tiny-engine-common@1.0.1 - @opentiny/tiny-engine-controller@1.0.2 - @opentiny/tiny-engine@1.0.0-beta.3 - @opentiny/tiny-engine-http@1.0.1 - @opentiny/tiny-engine-i18n-host@1.0.2 - @opentiny/tiny-engine-plugin-block@1.0.2 - @opentiny/tiny-engine-plugin-bridge@1.0.2 - @opentiny/tiny-engine-plugin-data@1.0.2 - @opentiny/tiny-engine-plugin-datasource@1.0.2 - @opentiny/tiny-engine-plugin-help@1.0.2 - @opentiny/tiny-engine-plugin-i18n@1.0.2 - @opentiny/tiny-engine-plugin-materials@1.0.2 - @opentiny/tiny-engine-plugin-page@1.0.2 - @opentiny/tiny-engine-plugin-robot@1.0.2 - @opentiny/tiny-engine-plugin-schema@1.0.2 - @opentiny/tiny-engine-plugin-script@1.0.2 - @opentiny/tiny-engine-plugin-tree@1.0.2 - @opentiny/tiny-engine-plugin-tutorial@1.0.2 - @opentiny/tiny-engine-setting-design@1.0.2 - @opentiny/tiny-engine-setting-events@1.0.2 - @opentiny/tiny-engine-setting-props@1.0.2 - @opentiny/tiny-engine-setting-styles@1.0.2 - @opentiny/tiny-engine-svgs@1.0.3 - @opentiny/tiny-engine-theme-dark@1.0.3 - @opentiny/tiny-engine-theme-light@1.0.4 - @opentiny/tiny-engine-toolbar-breadcrumb@1.0.2 - @opentiny/tiny-engine-toolbar-clean@1.0.2 - @opentiny/tiny-engine-toolbar-collaboration@1.0.2 - @opentiny/tiny-engine-toolbar-fullscreen@1.0.2 - @opentiny/tiny-engine-toolbar-generate-vue@1.0.2 - @opentiny/tiny-engine-toolbar-lang@1.0.3 - @opentiny/tiny-engine-toolbar-layout@1.0.3 - @opentiny/tiny-engine-toolbar-checkinout@1.0.2 - @opentiny/tiny-engine-toolbar-logo@1.0.2 - @opentiny/tiny-engine-toolbar-logout@1.0.3 - @opentiny/tiny-engine-toolbar-media@1.0.2 - @opentiny/tiny-engine-toolbar-preview@1.0.2 - @opentiny/tiny-engine-toolbar-redoundo@1.0.2 - @opentiny/tiny-engine-toolbar-refresh@1.0.2 - @opentiny/tiny-engine-toolbar-save@1.0.2 - @opentiny/tiny-engine-toolbar-setting@1.0.2 - @opentiny/tiny-engine-utils@1.0.3 - @opentiny/tiny-engine-dsl-vue@1.0.2 - @opentiny/tiny-engine-webcomponent-core@1.0.3 * fix: 修复数据源mock数据不一致 (#211) * fix: 修复数据源mock数据不一致 * fix:修复构建物料资产包重复组件 * fix:修改css文件cdn域名 (#228) * fix:修改css文件cdn地址 * fix default img can't change width and height (#189) * fix:插件面板固定后画布未自适应 (#234) * fix: 修复数据源mock数据不一致 * fix:插件面板固定后画布未自适应 * fix:插件面板固定后画布未自适应 * fix:修复eslint报错 * [plugin-data] Fix state use jsfunction issue (#237) * feat(monaco-editor-completion): 隔离不同代码编辑器自动补全的注册,变量声明增加自动补全去掉js函数和state变量的自动补全提示 * feat(state): 状态管理使用JS表达式创建变量的时候提示不可使用其他变量以及JS函数 * fix:materials sql (#231) * fix: 修复数据源mock数据不一致 * fix:新增组件写入sql数据问题 * fix:修复资源管理工具类型切换 (#239) * fix:修复资源管理工具类型切换 * fix: 左右两侧面板宽度固定为280px (#230) * fix(styles-spacing): 增大物料设置内外边距时点击区域 #134 (#184) * fix(styles-spacing): 增大物料设置内外边距时点击区域 #134 * fix:预览引入builtin组件依赖,built组件样式文件注入js (#251) * add config (#262) * add config * update config * fix: 修复由于物料边框引起的左侧面板样式问题 (#247) * fix: 设计器构建后使用vue runtime prod build(本地开发保持development, preview预览保持development) (#254) * fix(canvas-renderer): 修复 isNative component 判断失效的 bug (#241) * feat: js panel add jsx support (#253) * feat: JS面板支持JSX语法 * fix: 画布解析JS表达式时支持JSX语法 * fix: 修复画布解析JSX表达式时会返回undefined * feat: 添加Tree和Tooltip的自定义渲染函数属性 * fix: 修改变量名 * fix(toolbar-save): 修复保存时红色 icon 相对位置丢失的 bug (#250) * feat(setting-stylePanel): 样式面板编辑全局样式新UI与交互 (#238) * feat(setting-stylePanel): 样式面板编辑全局样式新UI与交互 * feat(setting-stylePanel): 样式面板编辑全局样式新UI与交互 * feat(setting-stylePanel): 样式面板编辑全局样式新UI与交互-细节优化 * feat(setting-stylePanel): 样式面板编辑全局样式新UI与交互-细节优化 * fix(settingPanel-style): 样式面板新交互细节调整 * fix(setting-stylePanel): 修复样式选择器颜色不对的 bug * fix(setting-stylePanel): 样式选择器间距调整 * fix(setting-stylePanel): 调整样式选择器距离顶部距离与下拉列表滚动条颜色 * feat(setting-style): add help link button * fix(setting-style): delete empty row by code review * fix(material-panel-svg): 修复物料左侧插件面板里图标旋转的问题 (#280) * docs(readme): 增加后端的启动描述 * docs(readme): 增加后端的启动描述 * docs(readme): 增加后端的启动描述 * docs(readme): 增加后端的启动描述 * docs(readme): 更新图片地址 * docs(readme): 更新图片地址 * fix(material-panel-svg): 修复物料左侧插件面板里图标旋转的问题 * fix:组件sql语句字段校验、提示优化 (#275) * fix:修复新增组件sql语句字段校验 * fix:优化脚本提示 * fix:函数名优化 * fix:修复更新的sql问题 * fix:TinyTabItem、TinyBreadcrumbItem组件配置有误 (#272) * fix:TinyTabItem、TinyBreadcrumbItem组件配置有误 * fix:修复tiny-vue组件导出名称有误 * fix: 修复robot plugin不存在时发生的白屏错误 (#271) * fix: 修复robot plugin不存在时发生的白屏错误 * styled: 修改代码风格 * fix: 修改监视意见 * fix: 修复画布选中框的显示层级不正确的问题 (#246) * fix: 修复画布选中框的显示层级不正确的问题 * fix: 修正错误注释 * fix: 选中节点后支持横向滚动到节点 * fix: 根据垂直滚动条调整工具操作条位置 * fix: 删除冗余代码 * fix: 代码优化 * fix: 修改变量名称 * fix: 调整函数顺序,消除eslint错误 * feat: 移除前端解锁前判断权限的逻辑,适配后台解锁接口 (#276) * 修复画布没有根元素,与vue出码、预览不一致 (#259) * feat: 页面输入输出配置,配置内有内容时,按钮替换为展示部分文案内容。 * feat: 方法名修改更加符合语义 * fix: 1. 给画布添加根元素(与出码、预览保持一致)。2. 选中画布相当于选中根节点,右侧面板会出现可以添加属性的节点。3. 可以支持给根节点添加类名,id、ref,并修改样式。 4. 支持给根元素添加事件,循环等 * fix: 意见修复 * fix: 修复较低的分辨率下画布初始缩放不正确的问题 (#274) * fix(common): fix lifecycle unmount completionProvider null state caught error (#281) * fix: 修改远程字段发送请求无效 (#278) * fix:修复修改远程字段发送请求无效 * fix:修复请求参数处理函数未生效 * fix:修复数据源表单校验提前退出 * fix:修改提示语 * fix:按review添加注释 * Fix mockServer block group deleted bug (#279) * fix:修复第三方组件无法渲染 (#288) * fix:修复第三方组件无法渲染 * fix:区分环境加载prod * fix(chore): sync vue version (#285) * fix(chore): sync vue version * fix(chore): sync vue-i18n version * fix(chore): change vue and vue-i18n to peerdependencies * fix(chore): update block build dependencies * fix(chore): change vue-generator dependencies to update * fix(upload-button)修复下载按钮弹出没有遮罩 (#300) * fix: 修复新建区块的表单确定时未校验的问题 (#302) * fix: 修复代码编辑器全屏时的样式问题 (#303) * fix: 修复属性面板中设置空字符串的问题 (#307) * fix(setting-stylePanel): 只允许有一个 id,样式选择器只能添加一个 id (#295) * fix(plugin-page): setting home should not close settingPanel (#308) * feat(setting-advanced): addcustomEvent popover change to dialog (#297) * feat(setting-advanced): addcustomEvent popover change to dialog * fix(setting-advanced): add custom event align left with modal title * fix(style): delete selected symbol on select component (#306) * fix(style): delete selected symbol on select component * fix(style): delete space after delete selectedSymbol * fix(http): 优化 http 接口报错 ui, 接口详情不展示在 title (#293) * fix: 修复preview生产打包的时候repl引入的monaco-editor里的worker跨域报错 (#245) * fix: 修复preview生产打包的时候repl引入的monaco-editor里的worker跨域报错 * feat(design-core/preview): 预览增加调试按钮来打开vue-repl编辑模式,并实现编辑器懒加载 * fix(design-core/preview): 修复repl-patch引入脚本路径模块化不支持importScripts问题 * fix: 数据源远程字段表单验证样式修改 (#309) * fix: 数据源远程字段表单验证样式修改 * fix:资源管理工具类型文字字色与设计稿不一致 (#319) * fix:资源管理工具类型文字字色与设计稿不一致 * fix:调整资源工具类型字体 * bundle.json and tiny-vue.css is 404 in prod mode (#315) * chore(release): publish (#320) - @opentiny/tiny-engine-mock: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-block-build: 1.0.1 => 1.0.2 - @opentiny/tiny-engine-builtin-component: 1.0.0 => 1.0.1 - @opentiny/tiny-engine-canvas: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-common: 1.0.1 => 1.0.2 - @opentiny/tiny-engine-controller: 1.0.2 => 1.0.3 - @opentiny/tiny-engine: 1.0.0-beta.3 => 1.0.0-beta.4 - @opentiny/tiny-engine-http: 1.0.1 => 1.0.2 - @opentiny/tiny-engine-i18n-host: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-plugin-block: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-plugin-bridge: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-plugin-data: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-plugin-datasource: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-plugin-help: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-plugin-i18n: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-plugin-materials: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-plugin-page: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-plugin-robot: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-plugin-schema: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-plugin-script: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-plugin-tree: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-plugin-tutorial: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-setting-design: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-setting-events: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-setting-props: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-setting-styles: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-svgs: 1.0.3 => 1.0.4 - @opentiny/tiny-engine-theme-dark: 1.0.3 => 1.0.4 - @opentiny/tiny-engine-theme-light: 1.0.4 => 1.0.5 - @opentiny/tiny-engine-toolbar-breadcrumb: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-toolbar-clean: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-toolbar-collaboration: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-toolbar-fullscreen: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-toolbar-generate-vue: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-toolbar-lang: 1.0.3 => 1.0.4 - @opentiny/tiny-engine-toolbar-layout: 1.0.3 => 1.0.4 - @opentiny/tiny-engine-toolbar-checkinout: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-toolbar-logo: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-toolbar-logout: 1.0.3 => 1.0.4 - @opentiny/tiny-engine-toolbar-media: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-toolbar-preview: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-toolbar-redoundo: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-toolbar-refresh: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-toolbar-save: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-toolbar-setting: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-utils: 1.0.3 => 1.0.4 - @opentiny/tiny-engine-dsl-vue: 1.0.2 => 1.0.3 - @opentiny/tiny-engine-webcomponent-core: 1.0.3 => 1.0.4 * refactor: 解决子包循环依赖问题 (#313) * refactor: move common/js to controller/js * refactor: replace common/js * refactor: replace ../js * refactor: update package.json * refactor: resolve canvas rely on common * refactor: remove controller deps in http * refactor: add canvas renderer state * refactor: remove useless file ext * refactor: modify controller deps path * refactor: fix eslint * refactor: resolve http env * fix: switch page error (#331) * fix: drag block into canvas error (#336) * fix: canvas api error (#338) * fix(datasource): data type icon invisible #312 (#332) * fix(datasource): data type icon invisible * fix(common): #325 reduce unnecessary network requests. * style(datasource): remove unnecessary comment --------- Co-authored-by: zeyong.cai <zeyong.cai@xquant.com> * fix(build): 修复构建设计器产物 ref 值未转化的 bug (#347) * fix(preview): fix preview vue-repl unsupport jsx bug (#343) * docs: add project name to issue template (#335) * feat: 状态管理代码编辑UI优化 (#318) * feat: 状态管理代码编辑UI优化 * fix(material): elTable formatter should be function type (#355) * fix(readme-build): 添加Readme中构建产物所在文件夹信息 (#367) * fix(scrollbar): fix robot plugin scrollbar hide almost all scrollbar bug (#340) * fix(scrollbar): fix robot plugin scrollbar hide almost all scrollbar bug * fix(scrollbar): change by review comment * fix(theme-scrollbar): change by review comment * fix(theme-base): apply default scrollbar style to body * children * docs: 文件名称CHANGELOG拼写错误,修改文件名称 (#389) * fix(errorMonitor): add config for errormonitor (#381) * fix(controller-environment): preserve import.meta.env variable when build controller lib (#380) * fix(settings): fix text wrap of bind condition (#391) Fixes #370 * feat:增加物料:TinyDatePicker和TinyNumeric (#399) * 增加物料:TinyDatePicker和TinyNumeric * 修改disabled使用MetaSwitch * Fix:编辑器设置dark主题后预览页header文字颜色不正确 (#403) * fix:编辑器设置dark主题后预览页header文字颜色不正确 * fix:调整主题 * fix(material): add buttonComponentsMap config (#395) * fix(demo-data): 修复官方 demo 页面底部确认购买模块移动端设备宽度下被遮住的场景 (#398) * fix(err-monitor): stop monitoring if monitorurl not exist (#423) * fix(err-monitor): stop monitoring if monitorurl not exist * fix(error-monitor): cancel request if url not exist * fix(chore): fix some vue warining on console (#421) * fix(controller): build with env variable (#420) * Feat provide eslint prettier modify config (#385) * fix(monaco-eslint): 修复eslint-worker支持问题 * fix(linter): 解决cdn后eslint worker相对路径问题 * fix: 移除多余的包 * feat(controller): eslint、prettier新增配置文件,worker文件打包从主应用改为随着分应用打包 * fix(controller): 修复eslint worker地址 * feat(controller): eslint-linter-browserify 降版本 * build: 去掉define process.env设置为空对象(旧版tinyVue库需要),当前引起eslint-linter-browserify脚本(已经处理过process的包)构建报错,且主应用有nodePollyfill可以处理process场景重复了 * fix(controller): 去掉多余注释和测试代码注释 * fix: 解决代码检视问题, 去掉注释,补充包引用去掉external,去掉多余的新增依赖 * feat: 单页预览格式化统一引用prettierrc文件配置 * fix: 解决子包的js没有打包为入口的问题 * fix(controller): 修复因目录结构改变需要worker打包为相对地址 * fix: 修复画布组件嵌套拖拽的问题 (#364) * fix: 修复画布组件嵌套拖拽的问题 * fix: 修复画布设置成自由布局后无法拖动drag-resize改变宽高的问题 (#393) * fix(canvas): wrapper runner render contextinitializationwithfunction#161(#426) * fix(chore): update pr check node version (#431) * fix(dsl-page):修复本地运行中对于props属性引用utils出码报错的问题 (#346) * fix(dsl-page):修复对于props属性引用utils出码报错的问题 * fix(dsl-page):修复对于props属性引用utils出码报错的问题-review * fix(plugin-dataSource): 修复数据源面板新增时未校验名称的重复性 (#434) * fix: 修改滚动到节点的逻辑,适配超宽超高组件 (#428) * fix(data-source): on configuring static data panel, the batch delete button should horizontally aligned. (#413) * 【设计器】静态数据配置面板,批量删除未对齐 BUG202403140918 * (style-position)修复样式定位reset后未恢复默认值 (#433) * fix(chore): fix vue version of 3.4.24 caught tiny-select component error (#445) * 修复918.json mock数据不一致问题 (#452) * 新建区块弹出框点击遮罩层会关闭 (#447) * fix(block-diff): 修复区块发布是查看差异保存时schema出错的bug (#453) * fix(dataSource): 数据源新增字段时,新增的表单设置在列表头部,且数组插入数据时插入到头部 (#454) * fix(reset-button): 修复样式配置中重置按钮的样式和设计稿不一致的问题 (#435) * Fix/serarch empty:为对部分功能设置搜索为空样式处理 (#446) * 修复新增页面搜索条件存在并没有触发 (#448) * fix(canvas-CanvasContainer): 修改Model单词拼写错误 (#468) * fix(canvas): add placeholder for empty container #365 (#436) * fix(canvas): add placeholder for empty container * feat(canvas-render): optimize by review comment * feat(canvasApi): use canvasApi to access canvas methods (#425) * feat(canvasApi): use canvasApi to access canvas methods * fix(canvas): optimize import order * fix(canvasApi): change by review comment tips * feat(chore): update OpenTinyVue version (#457) * feat(chore): update OpenTinyVue version * feat(chore): update opentinyvue version * fix(breadcrumb): fix breadcrumb style after update opentiny vue version * feat(chore): change opentinyvue to peer dependencies * feat(builtinComponent): add vue to peerDependencies * feat(vue-dsl): add app generate code (#178) * feat(vue-dsl): add app generate code * feat(vue-dsl): add app generate code * feat(vue-dsl): add generate global store code * feat(vue-dsl): delete parse config and parse schema hook * feat(tempalte): refra generateTemplate logic * feat(vue-generator): add generate script frame code * feat(vue-generator): add hook flow for sfc file generate * feat(vue-generator): support generate sfc script * feat(vue-generator): support jsx generate * fix(vue-generator): fix double quotes issue * feat(vue-generator): handle app generate code * feat(toolbar-generate-vue): toolbar-generate-vue use new codegen function * feat(vue-generator): add requiredBlock parser * feat(docs): add readme doc * feat(docs): add more docs * fix(vue-generator): adapt for more scenario * feat(vue-generator): support tiny-grid editor use tiny component * fix(vue-generator): complete unit test * fix(vue-generator): add unit test * feat(vue-generator): add sfc generator unit test * feat(vue-generator[docs]): add contributing docs * feat(vue-generator): add test coverage script and app generate test case * fix(generate-vue): optimize desc and file list * fix(vue-generate): [template] fix viteConfig process.env is processed * fix(vue-generator): escape process.env string * feat(vue-generator): support builtin components * fix(vue-generator): add builtin componentsMap * fix(vue-generator): fix bind utils props * fix(vue-generator): support utils expression * fix(vue-generator): support children expression add utils * fix(vue-generator): support nested folder page * fix(vue-generator): support get datasource with name * fix(vue-generator): only write necessary dependencies into package.json * feat(vue-generator): simplified genTemplate hooks * fix(vue-generator): update vue-generator docs * feat(vue-generator): detect jsx on custom method * feat(vue-generator): add d.ts types declaration * build: 公共依赖cdn解耦并增加开关控制 (#360) * build: external public cdn localize 公共cdn依赖包支持本地化 * build: cdn外部依赖解耦,修复baseUrl获取 * build: cdn依赖解耦 修正baseUrl获取方式 * build: cdn依赖三方解耦,优化目录型拷贝 * build: cdn依赖解耦,解决目录复制文件的相对路径问题 * build(design-core): 修复monaco的worker使用cdn地址前缀的情况下打包失效 * build: 本地开发也支持脱离cdn三方依赖 * build: 去除代码注释 * build: 三方cdn依赖解耦 物料bundle文件依赖支持替换cdn依赖 * build(design-core) 去除冗余用不到的文件和配置项硬编码 * build: 公共依赖cdn解耦测试完成 开关默认关闭 * refactor: 简化三方cdn依赖解耦的正则,改为path方法 * refactor: 三方依赖解耦脚本代码优化,减少雷同的正则匹配 * refactor: 三方cdn依赖解耦脚本 简化合并正则 * build: 三方cdn解耦 物料本地打包逻辑优化修正 * build: 三方cdn依赖解耦,优化代码简化正则,修复计算版本号问题,修复函数名大小写问题 * build: 优化importMap版本站位符号 * build: 三方cdn物料解耦 变量改为环境变量 * build: 三方cdn依赖解耦 补充处理复制文件夹时候的去重 * fix: 三方cdn解耦, 解决本地启动问题 * feat(preview): preview也支持cdn依赖解耦 * refactor(desing-core/scripts): 重构复制cdn文件本地复制模块 * build: 重构预览的importMap复制逻辑,修复两个importMap文件不存在 * build: 进一步优化monacoEditor地址,直接打包不再跨网络获取 * refactor(design-core/scripts): 调整复制应用importMap函数的参数顺序,与其他结构类似 * refactor(design-core/script): 调整文件位置和文件引用顺序 * feat(design-core/preview): preview importMap.js 使用 importMap.json 数据归一 * fix(design-core/preview): 修复importJson的引用 * fix: mock端口号订正,解决element-plus拖入画布后无法渲染 * build(design-core/script): 修复临时安装包插件安装完包后返回目录不正确 * fix: 修正monaco-editor的worker资源的打包地址 * build(design-core/script): 修复临时安装包插件安装完包后返回目录不正确 * fix(design-core/preview): 修正cdn解耦preview获取动态的importMap.json的base路径问题 * build: 三方cdn解耦,优化拷贝脚本,修复文件夹当文件拷贝当文件夹是包路径时候目标路径版本号丢失 * build: 三方cdn解耦,解决包未安装的情况下,glob匹配不到文件导致打包不拷贝内容 * fix: 根据检视意见使用fs-extra readJsonSync替代utils工具函数 * fix: 根据检视意见修改函数名大小写和端口号读取 * feat: 三方物料解耦 preview变量替换增加注释 * feat: 根据检视意见修改函数名字 * refactor: 根据检视意见,将脚本函数的参数整改为对象,并把目录值迁移到参数默认值 * docs(design-core/scripts): 三方cdn解耦 修正描述错误 * fix: 三方cdn解耦 修正preview脚本TinyVue版本号 * feat: 增加物料TinyEcharts和TinyTransitions * tiny-echarts v0.0.31 --------- Co-authored-by: OpenTiny <opentiny@sina.com> Co-authored-by: ajaxzheng <894103554@qq.com> Co-authored-by: chilingling <26962197+chilingling@users.noreply.github.com> Co-authored-by: wenmine <wwmmail@foxmail.com> Co-authored-by: lhuans <145339349+lhuans@users.noreply.github.com> Co-authored-by: yaoyun8 <142570291+yaoyun8@users.noreply.github.com> Co-authored-by: Hexqi <wu_12556@126.com> Co-authored-by: tianxin <146069396+ianxinnew@users.noreply.github.com> Co-authored-by: gargameljyh <58694428+gargameljyh@users.noreply.github.com> Co-authored-by: lichunn <46984087+lichunn@users.noreply.github.com> Co-authored-by: Xppp0217 <82315158+Xppp0217@users.noreply.github.com> Co-authored-by: lizhijie429 <632163606@qq.com> Co-authored-by: Gene <Pacify.98@gmail.com> Co-authored-by: rhlin <r.h.lin@live.cn> Co-authored-by: Lu17301156525 <128358973+Lu17301156525@users.noreply.github.com> Co-authored-by: rhlin <r.h.lin@163.com> Co-authored-by: GaoNeng <31283122+GaoNeng-wWw@users.noreply.github.com> Co-authored-by: abin <luocongqiu@gmail.com> Co-authored-by: zeyong tsai <tsai.zeyong@icloud.com> Co-authored-by: zeyong.cai <zeyong.cai@xquant.com> Co-authored-by: Kagol <kagol@sina.com> Co-authored-by: yuhki <128052955+yuhkikele@users.noreply.github.com> Co-authored-by: Xie Jay <xiejay97@gmail.com> Co-authored-by: fox ouyang <stwflyfox@163.com> Co-authored-by: 凌览 <58327088+CatsAndMice@users.noreply.github.com> Co-authored-by: betterdancing <liulinclear@163.com> Co-authored-by: jxhhdx <40119767+jxhhdx@users.noreply.github.com> Co-authored-by: zhoujunyu <rainrcn@qq.com>
2024-05-14 10:56:27 +08:00
import fsExtra from 'fs-extra'
import path from 'node:path'
import chokidar from 'chokidar'
import fg from 'fast-glob'
import MysqlConnection from './connection.mjs'
import Logger from './logger.mjs'
const logger = new Logger('buildMaterials')
// 物料文件存放文件夹名称
const materialsDir = 'materials'
// 物料资产包
const bundlePath = path.join(process.cwd(), '/packages/design-core/public/mock/bundle.json')
// mockServer应用数据
const appInfoPath = path.join(process.cwd(), '/mockServer/src/services/appinfo.json')
const appInfo = fsExtra.readJSONSync(appInfoPath)
const connection = new MysqlConnection()
/**
* 更新物料资产包和应用mock数据
*/
const write = (bundle) => {
fsExtra.outputJSONSync(bundlePath, bundle, { spaces: 2 })
fsExtra.outputJSONSync(appInfoPath, appInfo, { spaces: 2 })
}
/**
* 校验组件文件数据
* @param {string} file 组件文件路径
* @param {object} component 组件数据
* @returns
*/
const validateComponent = (file, component) => {
const requiredFields = ['component']
const fields = Object.keys(component)
const requiredList = requiredFields.filter((field) => !fields.includes(field))
if (requiredList.length) {
logger.error(`组件文件 ${file} 缺少必要字段:${requiredList.join('、')}`)
return false
}
if (!component.npm) {
logger.warn(`组件文件 ${file} 缺少 npm 字段出码时将不能通过import语句导入组件。`)
return false
}
return true
}
/**
* 校验区块文件数据
* @param {string} file 区块文件路径
* @param {object} block 区块数据
* @returns
*/
const validateBlock = (file, block) => {
const requiredFields = ['label', 'assets']
const fields = Object.keys(block)
const requiredList = requiredFields.filter((field) => !fields.includes(field))
if (requiredList.length) {
logger.error(`区块文件 ${file} 缺少必要字段:${requiredList.join('、')}`)
return false
}
return true
}
/**
* 读取materials目录下的json文件执行下列操作
* 1. 合并生成物料资产包
* 2. 更新应用的组件数据componentsMap
* 3. 连接上数据库后将组件数据写入数据库新增或更新
*/
const generateComponents = () => {
try {
fg([`${materialsDir}/**/*.json`]).then((files) => {
if (!files.length) {
logger.warn('物料文件夹为空,请先执行`pnpm splitMaterials`命令拆分物料资产包')
}
const bundle = {
data: {
framework: 'Vue',
materials: {
components: [],
blocks: [],
snippets: []
}
}
}
const { components = [], snippets = [], blocks = [] } = bundle.data.materials
const componentsMap = []
const appInfoBlocksLabels = appInfo.blockHistories.map((item) => item.label)
files.forEach((file) => {
const material = fsExtra.readJsonSync(file, { throws: false })
if (!material) {
const fileFullPath = path.join(process.cwd(), file)
logger.error(`文件格式有误 (${fileFullPath})`)
return
}
if (file.includes('/blocks/')) {
const valid = validateBlock(file, material)
if (!valid) return
blocks.push(material)
if (!appInfoBlocksLabels.includes(material.label)) {
appInfo.blockHistories.push(material)
}
return
}
const valid = validateComponent(file, material)
if (!valid) return
const { snippets: componentSnippets, category, ...componentInfo } = material
components.push(componentInfo)
const snippet = snippets.find((item) => item.group === category)
if (snippet) {
componentSnippets && snippet.children.push(componentSnippets[0])
} else if (category && componentInfo) {
snippets.push({
group: category,
children: componentSnippets || []
})
}
const { component, npm = {} } = componentInfo
componentsMap.push({ component, npm })
if (connection.connected) {
connection.initDB(material)
}
appInfo.materialHistory.components = componentsMap
write(bundle)
})
})
logger.success('物料资产包构建成功')
} catch (error) {
logger.error(`物料资产包构建失败:${error}`)
}
}
// 监听materials下json文件的变化
const watcher = chokidar.watch(`${materialsDir}/**/*.json`, { ignoreInitial: true })
watcher.on('all', (event, file) => {
const eventMap = {
add: '新增',
change: '更新',
unlink: '删除'
}
const fileFullPath = path.join(process.cwd(), file)
logger.info(`${eventMap[event]}组件文件 (${fileFullPath})`)
// 监听物料文件变化,更新物料资产包
generateComponents()
if (!connection.connected || event === 'unlink') return
const component = fsExtra.readJsonSync(fileFullPath)
if (event === 'change') {
connection.updateComponent(component, fileFullPath)
} else if (event === 'add') {
connection.insertComponent(component, fileFullPath)
}
})
// 连接数据库
connection
.connect()
.then(() => {
connection.initUserComponentsTable().finally(() => {
generateComponents()
})
})
.catch(() => {
// 未能连接数据库也可以执行更新本地mock数据
generateComponents()
})