chore: 整体优化
This commit is contained in:
@@ -1,10 +1,17 @@
|
||||
# 使用淘宝镜像源
|
||||
registry = https://registry.npmmirror.com
|
||||
@sy:registry=http://sy-registry.shiyue.com
|
||||
|
||||
|
||||
# 根据需要提升含有以下的依赖包到根 node_modules 目录下
|
||||
# public-hoist-pattern[]=husky
|
||||
# public-hoist-pattern[]=*eslint*
|
||||
# public-hoist-pattern[]=@eslint*
|
||||
# public-hoist-pattern[]=*prettier*
|
||||
# public-hoist-pattern[]=lint-staged
|
||||
# public-hoist-pattern[]=*stylelint*
|
||||
# public-hoist-pattern[]=@commitlint*
|
||||
# public-hoist-pattern[]=core-js
|
||||
# public-hoist-pattern[]=*@vtj*
|
||||
|
||||
# 提升所有依赖到根 node_modules 目录下,相当于 public-hoist-pattern[]=*,与上面一种方式一般二选一使用
|
||||
# 极不推荐用这样的方式解决依赖问题,这样没有充分利用 pnpm 依赖访问安全性的优势,又走回了 npm / yarn 的老路。
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"name": "Test",
|
||||
"locked": false,
|
||||
"inject": [],
|
||||
"state": {},
|
||||
"lifeCycles": {},
|
||||
"methods": {},
|
||||
"computed": {},
|
||||
"watch": [],
|
||||
"css": "",
|
||||
"props": [],
|
||||
"emits": [],
|
||||
"slots": [],
|
||||
"dataSources": {},
|
||||
"__VTJ_BLOCK__": true,
|
||||
"__VERSION__": "1739842497674",
|
||||
"id": "45t7j3xqi",
|
||||
"nodes": []
|
||||
}
|
||||
61
apps/designer/.vtj/files/45t9lzaxt.json
Normal file
61
apps/designer/.vtj/files/45t9lzaxt.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"name": "Home",
|
||||
"locked": false,
|
||||
"inject": [],
|
||||
"state": {},
|
||||
"lifeCycles": {},
|
||||
"methods": {},
|
||||
"computed": {},
|
||||
"watch": [],
|
||||
"css": "",
|
||||
"props": [],
|
||||
"emits": [],
|
||||
"slots": [],
|
||||
"dataSources": {},
|
||||
"__VTJ_BLOCK__": true,
|
||||
"__VERSION__": "1739970308179",
|
||||
"id": "45t9lzaxt",
|
||||
"nodes": [
|
||||
{
|
||||
"id": "2yyhfejyt2",
|
||||
"name": "ElMain",
|
||||
"from": "element-plus",
|
||||
"invisible": false,
|
||||
"locked": false,
|
||||
"children": [
|
||||
{
|
||||
"id": "45t9m1nhz",
|
||||
"name": "ElText",
|
||||
"from": "element-plus",
|
||||
"invisible": false,
|
||||
"locked": false,
|
||||
"children": "我是主页",
|
||||
"props": {
|
||||
"type": "primary",
|
||||
"size": "default",
|
||||
"style": {
|
||||
"color": "#FF3C00",
|
||||
"position": "absolute",
|
||||
"inset": "0% 0% 0% 0%",
|
||||
"background-repeat": "repeat",
|
||||
"text-align": "center"
|
||||
}
|
||||
},
|
||||
"directives": [],
|
||||
"events": {}
|
||||
}
|
||||
],
|
||||
"props": {
|
||||
"style": {
|
||||
"position": "relative",
|
||||
"object-fit": "none",
|
||||
"overflow": "visible",
|
||||
"display": "flex",
|
||||
"cursor": "auto"
|
||||
}
|
||||
},
|
||||
"directives": [],
|
||||
"events": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
17633
apps/designer/.vtj/materials/vtj-project.json
Normal file
17633
apps/designer/.vtj/materials/vtj-project.json
Normal file
File diff suppressed because one or more lines are too long
@@ -3,7 +3,7 @@
|
||||
"id": "@sy/low-code-designer",
|
||||
"platform": "web",
|
||||
"name": "低代码编辑器",
|
||||
"homepage": "",
|
||||
"homepage": "45t9lzaxt",
|
||||
"description": "低代码编辑器",
|
||||
"dependencies": [
|
||||
{
|
||||
@@ -102,7 +102,7 @@
|
||||
"assetsLibrary": "VtjUIMaterial",
|
||||
"required": false,
|
||||
"official": true,
|
||||
"enabled": false,
|
||||
"enabled": true,
|
||||
"platform": "web"
|
||||
},
|
||||
{
|
||||
@@ -142,7 +142,7 @@
|
||||
"assetsLibrary": "VtjChartsMaterial",
|
||||
"required": false,
|
||||
"official": true,
|
||||
"enabled": false,
|
||||
"enabled": true,
|
||||
"platform": [
|
||||
"web",
|
||||
"h5"
|
||||
@@ -152,16 +152,12 @@
|
||||
"pages": [
|
||||
{
|
||||
"dir": false,
|
||||
"name": "Test",
|
||||
"title": "1",
|
||||
"icon": "",
|
||||
"mask": true,
|
||||
"name": "Home",
|
||||
"title": "主页",
|
||||
"icon": "AddLocation",
|
||||
"hidden": false,
|
||||
"raw": false,
|
||||
"pure": false,
|
||||
"meta": "",
|
||||
"cache": false,
|
||||
"id": "45t7j3xqi",
|
||||
"id": "45t9lzaxt",
|
||||
"type": "page"
|
||||
}
|
||||
],
|
||||
@@ -169,8 +165,7 @@
|
||||
"apis": [],
|
||||
"meta": [],
|
||||
"config": {
|
||||
"title": "",
|
||||
"themeSwitchable": false
|
||||
"title": ""
|
||||
},
|
||||
"__BASE_PATH__": "/"
|
||||
}
|
||||
|
||||
15
apps/designer/.vtj/projects/vtj-project.json
Normal file
15
apps/designer/.vtj/projects/vtj-project.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"__VTJ_PROJECT__": true,
|
||||
"id": "vtj-project",
|
||||
"platform": "web",
|
||||
"name": "VTJ.PRO",
|
||||
"homepage": "",
|
||||
"description": "VTJ.PRO",
|
||||
"dependencies": [],
|
||||
"pages": [],
|
||||
"blocks": [],
|
||||
"apis": [],
|
||||
"meta": [],
|
||||
"config": {},
|
||||
"__BASE_PATH__": "/"
|
||||
}
|
||||
@@ -12,7 +12,7 @@
|
||||
<title>VTJ Web Project Template</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="low-code-designer"></div>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -5,31 +5,31 @@
|
||||
"version": "1.0.0-1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"setup": "npm install --unsafe-perm --registry=https://registry.npmmirror.com",
|
||||
"dev": "cross-env ENV_TYPE=local vite",
|
||||
"build": "npm run build:prod",
|
||||
"build:sit": "vue-tsc && cross-env ENV_TYPE=sit vite build",
|
||||
"build:uat": "vue-tsc && cross-env ENV_TYPE=uat vite build",
|
||||
"build:pre": "vue-tsc && cross-env ENV_TYPE=pre vite build",
|
||||
"build:prod": "cross-env ENV_TYPE=live vite build",
|
||||
"build:prod": "vue-tsc && cross-env ENV_TYPE=live vite build",
|
||||
"preview": "vite preview",
|
||||
"clean:lock": "rimraf pnpm-lock.yaml && rimraf package.lock.json",
|
||||
"clean:lib": "rimraf node_modules"
|
||||
"clean": "node ./scripts/clean.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vtj/materials": "^0.9.30",
|
||||
"@vtj/renderer": "^0.9.30",
|
||||
"@vtj/ui": "^0.9.30",
|
||||
"@vtj/web": "^0.9.30",
|
||||
"element-plus": "^2.9.4",
|
||||
"vue": "~3.5.13",
|
||||
"vue": "~3.5.0",
|
||||
"vue-router": "~4.5.0",
|
||||
"core-js": "^3.40.0"
|
||||
"element-plus": "^2.9.4",
|
||||
"@vtj/ui": "^0.9.30",
|
||||
"@vtj/materials": "^0.9.30"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sy/vite-plugin-http2-proxy": "workspace:*",
|
||||
"@vtj/cli": "^0.9.8",
|
||||
"@vtj/pro": "^0.9.30",
|
||||
"@vtj/local": "^0.9.30",
|
||||
"vite": "6.1.0",
|
||||
"vite-plugin-mkcert": "^1.17.6"
|
||||
}
|
||||
"@sy/vite-plugin-http2-proxy": "workspace:*",
|
||||
"vite-plugin-mkcert": "^1.17.6",
|
||||
"vite": "^6.1.1"
|
||||
},
|
||||
"packageManager": "pnpm@10.2.1+sha512.398035c7bd696d0ba0b10a688ed558285329d27ea994804a52bad9167d8e3a72bcb993f9699585d3ca25779ac64949ef422757a6c31102c12ab932e5cbe5cc92"
|
||||
}
|
||||
7
apps/designer/scripts/clean.mjs
Normal file
7
apps/designer/scripts/clean.mjs
Normal file
@@ -0,0 +1,7 @@
|
||||
import { rm } from 'fs/promises';
|
||||
console.log('开始清理...');
|
||||
await rm('node_modules', { recursive: true, force: true });
|
||||
await rm('dist', { recursive: true, force: true });
|
||||
await rm('package-lock.json', { recursive: true, force: true });
|
||||
await rm('pnpm-lock.yaml', { recursive: true, force: true });
|
||||
console.log('开始完成!');
|
||||
@@ -19,9 +19,9 @@ import { ElConfigProvider, ElMessage } from 'element-plus';
|
||||
import {
|
||||
XMask,
|
||||
useMask,
|
||||
// Bell,
|
||||
// Lock,
|
||||
// SwitchButton,
|
||||
Bell,
|
||||
Lock,
|
||||
SwitchButton,
|
||||
type ActionBarItems,
|
||||
type ActionProps
|
||||
} from '@vtj/web';
|
||||
@@ -30,19 +30,19 @@ import _logo from './assets/logo.svg';
|
||||
const { disabled, title, menus, logo, themeSwitchable, pure } = useMask();
|
||||
|
||||
const actions: ActionBarItems = [
|
||||
// {
|
||||
// name: 'message',
|
||||
// icon: Bell,
|
||||
// badge: 1
|
||||
// }
|
||||
// {
|
||||
// name: 'lock',
|
||||
// icon: Lock
|
||||
// },
|
||||
// {
|
||||
// name: 'logout',
|
||||
// icon: SwitchButton
|
||||
// }
|
||||
{
|
||||
name: 'message',
|
||||
icon: Bell,
|
||||
badge: 1
|
||||
},
|
||||
{
|
||||
name: 'lock',
|
||||
icon: Lock
|
||||
},
|
||||
{
|
||||
name: 'logout',
|
||||
icon: SwitchButton
|
||||
}
|
||||
];
|
||||
|
||||
const onActionClick = (action: ActionProps) => {
|
||||
|
||||
@@ -7,7 +7,8 @@ import {
|
||||
notify,
|
||||
loading,
|
||||
createAdapter,
|
||||
createServiceRequest
|
||||
createServiceRequest,
|
||||
IconsPlugin
|
||||
} from '@vtj/web';
|
||||
import { createApp } from 'vue';
|
||||
import router from './router';
|
||||
@@ -18,9 +19,7 @@ import './style/index.scss';
|
||||
const app = createApp(App);
|
||||
const adapter = createAdapter({ loading, notify });
|
||||
const service = new LocalService(createServiceRequest(notify));
|
||||
|
||||
// const modules = createModules();
|
||||
// console.log('modules', modules);
|
||||
console.log('service', service);
|
||||
const { provider, onReady } = createProvider({
|
||||
nodeEnv: process.env.NODE_ENV as NodeEnv,
|
||||
modules: createModules(),
|
||||
@@ -40,7 +39,8 @@ const { provider, onReady } = createProvider({
|
||||
onReady(async () => {
|
||||
app.use(router);
|
||||
app.use(provider);
|
||||
app.mount('#low-code-designer');
|
||||
app.use(IconsPlugin);
|
||||
app.mount('#app');
|
||||
});
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router';
|
||||
import { createRouter, createWebHashHistory } from 'vue-router';
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
history: createWebHashHistory(),
|
||||
routes: [
|
||||
{
|
||||
path: '/unauthorized',
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import { createViteConfig } from '@vtj/cli';
|
||||
import { createDevTools } from '@vtj/local';
|
||||
import http2Proxy from '@sy/vite-plugin-http2-proxy';
|
||||
import proxy from './proxy.config';
|
||||
import mkcert from 'vite-plugin-mkcert';
|
||||
import Http2Proxy from '@sy/vite-plugin-http2-proxy';
|
||||
import type { UserConfig, ConfigEnv } from 'vite';
|
||||
|
||||
const config = createViteConfig({
|
||||
plugins: [createDevTools(), mkcert({ source: 'coding' }), Http2Proxy()]
|
||||
proxy,
|
||||
plugins: [createDevTools(), http2Proxy(), mkcert()]
|
||||
});
|
||||
|
||||
// export default config;
|
||||
|
||||
export default ({ command, mode }: ConfigEnv): UserConfig => {
|
||||
return {
|
||||
...config,
|
||||
server: {
|
||||
cors: true
|
||||
}
|
||||
};
|
||||
};
|
||||
export default defineConfig({
|
||||
...config,
|
||||
server: {
|
||||
https: true,
|
||||
port: 10011,
|
||||
host: true
|
||||
}
|
||||
});
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
"@vueuse/core": "~11.1.0",
|
||||
"ant-design-vue": "~4.2.6",
|
||||
"axios": "~1.7.9",
|
||||
"core-js": "^3.40.0",
|
||||
"crypto-js": "^4.2.0",
|
||||
"dayjs": "~1.11.13",
|
||||
"file-saver": "~2.0.5",
|
||||
@@ -48,17 +49,17 @@
|
||||
"vue-types": "~5.1.3",
|
||||
"vue-virtual-scroller": "2.0.0-beta.8",
|
||||
"wujie-vue3": "^1.0.24",
|
||||
"xlsx": "~0.18.5",
|
||||
"core-js": "^3.40.0"
|
||||
"xlsx": "~0.18.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sy/vite-plugin-http2-proxy": "workspace:*",
|
||||
"@commitlint/cli": "~19.5.0",
|
||||
"@commitlint/config-conventional": "~19.5.0",
|
||||
"@iconify-json/ant-design": "^1.2.5",
|
||||
"@iconify-json/ep": "^1.2.2",
|
||||
"@iconify/json": "^2.2.307",
|
||||
"@sy/low-code-designer": "workspace:*",
|
||||
"@sy/low-code-shared": "workspace:*",
|
||||
"@sy/vite-plugin-http2-proxy": "workspace:*",
|
||||
"@types/crypto-js": "^4.2.2",
|
||||
"@types/lodash-es": "~4.17.12",
|
||||
"@types/node": "~22.7.9",
|
||||
@@ -98,7 +99,7 @@
|
||||
"typescript": "~5.6.3",
|
||||
"unocss": "^65.5.0",
|
||||
"unplugin-vue-components": "~0.27.5",
|
||||
"vite": "~6.1.0",
|
||||
"vite": "~6.1.1",
|
||||
"vite-plugin-checker": "~0.8.0",
|
||||
"vite-plugin-inspect": "^10.2.1",
|
||||
"vite-plugin-mkcert": "^1.17.6",
|
||||
|
||||
1
apps/platform/src/constants/index.ts
Normal file
1
apps/platform/src/constants/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from '@sy/low-code-shared/constants';
|
||||
@@ -19,7 +19,7 @@ const routes: Array<RouteRecordRaw> = [
|
||||
title: '低代码编辑器',
|
||||
icon: 'ant-design:edit-outlined',
|
||||
app: {
|
||||
url: 'https://localhost:5173',
|
||||
url: 'https://localhost:10011/__vtj__/',
|
||||
name: 'low-code-designer',
|
||||
sync: true,
|
||||
alive: true,
|
||||
@@ -34,10 +34,10 @@ const routes: Array<RouteRecordRaw> = [
|
||||
meta: {
|
||||
title: '低代码渲染器',
|
||||
keepAlive: true,
|
||||
hideInMenu: true,
|
||||
// hideInMenu: true,
|
||||
icon: 'ant-design:eye-outlined',
|
||||
app: {
|
||||
url: 'https://localhost:9000',
|
||||
url: 'https://localhost:10010',
|
||||
name: 'low-code-renderer',
|
||||
// sync: true,
|
||||
// alive: true,
|
||||
@@ -46,6 +46,24 @@ const routes: Array<RouteRecordRaw> = [
|
||||
},
|
||||
component: () => import('@/components/micro-container/index.vue'),
|
||||
},
|
||||
{
|
||||
path: 'y-code-v1',
|
||||
name: `${moduleName}-y-code-v1`,
|
||||
meta: {
|
||||
title: '悦码 1.0',
|
||||
// keepAlive: true,
|
||||
// hideInMenu: true,
|
||||
icon: 'ant-design:delete-outlined',
|
||||
app: {
|
||||
url: 'http://localhost:10012',
|
||||
name: 'y-code-v1',
|
||||
// sync: true,
|
||||
// alive: true,
|
||||
// degrade: true,
|
||||
},
|
||||
},
|
||||
component: () => import('@/components/micro-container/index.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@@ -13,6 +13,9 @@ import Http2Proxy from '@sy/vite-plugin-http2-proxy';
|
||||
import Inspector from 'vite-plugin-vue-inspector';
|
||||
import pkg from './package.json';
|
||||
import type { UserConfig, ConfigEnv } from 'vite';
|
||||
// import { DEV_SERVER_PORT } from '@sy/low-code-shared/dist/constants';
|
||||
|
||||
// console.log(DEV_SERVER_PORT);
|
||||
|
||||
const CWD = process.cwd();
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ export default defineConfig({
|
||||
],
|
||||
server: {
|
||||
cors: true,
|
||||
// open: true,
|
||||
port: 10012,
|
||||
},
|
||||
compilation: {
|
||||
resolve: {
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
"semantic-release": "^24.2.2",
|
||||
"typescript": "~5.3.3",
|
||||
"unplugin-vue-components": "^0.26.0",
|
||||
"vite": "^6.1.0",
|
||||
"vite": "^6.1.1",
|
||||
"vite-plugin-qiankun": "^1.0.15",
|
||||
"vue-tsc": "^2.2.0",
|
||||
"yargs-parser": "^21.1.1"
|
||||
|
||||
Reference in New Issue
Block a user