diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d342556..65f8298 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,5 +1,10 @@ name: deploy +env: + # 7 GiB by default on GitHub, setting to 6 GiB + # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources + NODE_OPTIONS: --max-old-space-size=6144 + on: push: branches: [main] @@ -16,10 +21,10 @@ jobs: node-version: '14.x' - name: Install - run: npm install + run: yarn install --frozen-lockfile - name: Build - run: npm run build + run: yarn build - name: Deploy uses: peaceiris/actions-gh-pages@v3 diff --git a/components.d.ts b/components.d.ts new file mode 100644 index 0000000..256150c --- /dev/null +++ b/components.d.ts @@ -0,0 +1,29 @@ +// generated by vite-plugin-components +// read more https://github.com/vuejs/vue-next/pull/3399 + +declare module 'vue' { + export interface GlobalComponents { + ElHeader: typeof import('element-plus/es/el-header')['default'] + ElAside: typeof import('element-plus/es/el-aside')['default'] + ElMain: typeof import('element-plus/es/el-main')['default'] + ElContainer: typeof import('element-plus/es/el-container')['default'] + ElCol: typeof import('element-plus/es/el-col')['default'] + ElButton: typeof import('element-plus/es/el-button')['default'] + ElTooltip: typeof import('element-plus/es/el-tooltip')['default'] + ElRow: typeof import('element-plus/es/el-row')['default'] + ElPopover: typeof import('element-plus/es/el-popover')['default'] + ElTabPane: typeof import('element-plus/es/el-tab-pane')['default'] + ElTabs: typeof import('element-plus/es/el-tabs')['default'] + ElDialog: typeof import('element-plus/es/el-dialog')['default'] + ElTag: typeof import('element-plus/es/el-tag')['default'] + ElDropdownItem: typeof import('element-plus/es/el-dropdown-item')['default'] + ElDropdownMenu: typeof import('element-plus/es/el-dropdown-menu')['default'] + ElDropdown: typeof import('element-plus/es/el-dropdown')['default'] + ElTree: typeof import('element-plus/es/el-tree')['default'] + ElInput: typeof import('element-plus/es/el-input')['default'] + ElFormItem: typeof import('element-plus/es/el-form-item')['default'] + ElForm: typeof import('element-plus/es/el-form')['default'] + } +} + +export {} diff --git a/package.json b/package.json index 0802d89..de0e387 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "private": false, "description": "A Vite2.x + Vue3 + TypeScript LowCode", "scripts": { - "dev": "vite", - "build": "vite build", + "dev": "cross-env --max_old_space_size=4096 vite", + "build": "cross-env vite build", "build-tsc": "vue-tsc --noEmit && vite build", "serve": "vite preview", "deploy": "gh-pages -d dist", @@ -27,53 +27,54 @@ "axios": "^0.21.1", "dayjs": "^1.10.5", "dexie": "^3.0.3", - "element-plus": "^1.0.2-beta.48", + "element-plus": "1.0.2-beta.51", "lodash": "^4.17.21", - "monaco-editor": "^0.25.0", + "monaco-editor": "^0.25.2", "normalize.css": "^8.0.1", "nprogress": "^1.0.0-1", "qrcode": "^1.4.4", - "vant": "^3.0.18", - "vue": "3.1.1", - "vue-router": "^4.0.8", + "vant": "^3.1.0", + "vue": "3.1.2", + "vue-router": "^4.0.10", "vuedraggable": "^4.0.3", - "vuex": "^4.0.1" + "vuex": "^4.0.2" }, "devDependencies": { "@commitlint/cli": "^12.1.4", "@commitlint/config-conventional": "^12.1.4", - "@types/node": "^15.12.2", - "@typescript-eslint/eslint-plugin": "^4.27.0", - "@typescript-eslint/parser": "^4.27.0", - "@vitejs/plugin-legacy": "^1.4.1", + "@types/node": "^15.12.4", + "@typescript-eslint/eslint-plugin": "^4.28.0", + "@typescript-eslint/parser": "^4.28.0", + "@vitejs/plugin-legacy": "^1.4.2", "@vitejs/plugin-vue": "^1.2.3", "@vitejs/plugin-vue-jsx": "^1.1.5", - "@vue/compiler-sfc": "3.1.1", + "@vue/compiler-sfc": "3.1.2", "commitizen": "^4.2.4", + "cross-env": "^7.0.3", "cz-conventional-changelog": "^3.3.0", "cz-customizable": "^6.3.0", - "eslint": "^7.28.0", + "eslint": "^7.29.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.23.4", "eslint-plugin-prettier": "^3.4.0", "eslint-plugin-vue": "^7.11.1", - "gh-pages": "^3.2.1", + "gh-pages": "^3.2.3", "husky": "^6.0.0", "lint-staged": "^11.0.0", "prettier": "^2.3.1", - "pretty-quick": "^3.1.0", - "sass": "1.35.0", + "pretty-quick": "^3.1.1", + "sass": "1.35.1", "stylelint": "^13.13.1", "stylelint-config-prettier": "^8.0.2", "stylelint-config-standard": "^22.0.0", "stylelint-order": "^4.1.0", - "typescript": "^4.3.2", - "vite": "2.3.7", - "vite-plugin-components": "^0.11.1", - "vite-plugin-style-import": "^0.10.1", - "vite-plugin-windicss": "^1.0.3", + "typescript": "^4.3.4", + "vite": "2.3.8", + "vite-plugin-components": "^0.11.2", + "vite-plugin-style-import": "^1.0.0", + "vite-plugin-windicss": "^1.1.1", "vue-eslint-parser": "^7.6.0", - "vue-tsc": "^0.1.7", + "vue-tsc": "^0.2.0", "windicss": "^3.1.3" }, "repository": { diff --git a/preview/views/comp-render.tsx b/preview/views/comp-render.tsx index 5783fb0..328a3d5 100644 --- a/preview/views/comp-render.tsx +++ b/preview/views/comp-render.tsx @@ -1,10 +1,10 @@ /* * @Author: 卜启缘 * @Date: 2021-05-04 05:36:58 - * @LastEditTime: 2021-06-14 10:03:06 + * @LastEditTime: 2021-06-24 00:36:24 * @LastEditors: 卜启缘 * @Description: - * @FilePath: \vite-vue3-lowcode\preview\views\comp-render.tsx + * @FilePath: \vite-vue3-lowcode\src\visual-editor\components\simulator-editor\comp-render.tsx */ import { defineComponent, PropType } from 'vue' import { VisualEditorBlockData, VisualEditorConfig } from '@/visual-editor/visual-editor.utils' @@ -22,15 +22,13 @@ export default defineComponent({ } }, setup(props) { - return () => { - const component = props.config.componentMap[props.element.componentKey] - return component.render({ + return () => + props.config.componentMap[props.element.componentKey].render({ size: {}, props: props.element.props || {}, model: {}, block: props.element, custom: {} }) - } } }) diff --git a/preview/views/preview.vue b/preview/views/preview.vue index fd5ed51..bfca528 100644 --- a/preview/views/preview.vue +++ b/preview/views/preview.vue @@ -1,11 +1,19 @@ +