chore: 增加 build:statging

This commit is contained in:
wangxuefeng 2025-03-12 19:35:05 +08:00
parent 5f8609fc02
commit 6016504c94
12 changed files with 114 additions and 148 deletions

View File

@ -5,6 +5,7 @@
"type": "module", "type": "module",
"scripts": { "scripts": {
"build": "vitepress build", "build": "vitepress build",
"build:staging": "vitepress build --mode staging",
"dev": "vitepress dev", "dev": "vitepress dev",
"docs:preview": "vitepress preview" "docs:preview": "vitepress preview"
}, },

View File

@ -10,6 +10,7 @@
"scripts": { "scripts": {
"build": "pnpm vite build --mode production", "build": "pnpm vite build --mode production",
"build:analyze": "pnpm vite build --mode analyze", "build:analyze": "pnpm vite build --mode analyze",
"build:staging": "pnpm vite build --mode staging",
"dev": "pnpm vite --mode development", "dev": "pnpm vite --mode development",
"preview": "vite preview", "preview": "vite preview",
"typecheck": "vue-tsc --noEmit --skipLibCheck" "typecheck": "vue-tsc --noEmit --skipLibCheck"

View File

@ -1,76 +0,0 @@
<script setup lang="ts">
import { onMounted, ref } from 'vue';
import { useRoute } from 'vue-router';
import Postmate from 'postmate';
import { useUserStore } from '#/store/user';
const userStore = useUserStore();
// const MAX_RETRIES = 3;
const route = useRoute();
// const MAX_RETRIES = 3;
const loading = ref(true);
const errorMessage = ref('');
// const retryCount = ref(0);
const initPostmate = async () => {
loading.value = true;
errorMessage.value = '';
const container = document.querySelector('#low-code-adapter');
if (!container) {
errorMessage.value = '容器元素未找到';
loading.value = false;
return;
}
const connection = new Postmate({
container,
url: route.meta?.app?.url,
name: 'y-code-renderer',
classListArray: ['responsive-iframe'],
model: {
accessToken: userStore.token,
name: route.meta?.app?.name,
applicationId: route.meta?.app?.applicationId,
projectId: route.meta?.app?.projectId,
fileId: route.meta?.app?.fileId,
url: route.meta?.app?.url,
},
});
connection.then((child) => {
// console.log('Postmate ', child);
child.on('some-event', (data) => console.log(data)); // Logs "Hello, World!"
child.call('child-connected', {
name: route.meta?.app?.name,
});
// retryCount.value = 0; //
});
};
onMounted(() => {
initPostmate();
});
</script>
<template>
<div id="low-code-adapter"></div>
</template>
<style>
.responsive-iframe {
width: 100%;
height: 100%;
border: none;
}
</style>
<style lang="scss" scoped>
#low-code-adapter {
width: 100%;
height: 100%;
}
</style>

View File

@ -16,6 +16,10 @@
"dependsOn": ["@sy/vue3-renderer-adapter#build", "^build"], "dependsOn": ["@sy/vue3-renderer-adapter#build", "^build"],
"outputs": ["dist/**"] "outputs": ["dist/**"]
}, },
"build:staging": {
"dependsOn": ["@sy/vue3-renderer-adapter#build", "^build:staging"],
"outputs": ["dist/**"]
},
"dev": { "dev": {
"dependsOn": ["@sy/vue3-renderer-adapter#build"], "dependsOn": ["@sy/vue3-renderer-adapter#build"],
"outputs": [], "outputs": [],

View File

@ -5,7 +5,7 @@
"scripts": { "scripts": {
"dev": "vite dev --mode development", "dev": "vite dev --mode development",
"build": "vite build --mode production", "build": "vite build --mode production",
"build:staging": "vite build --mode staging", "#build:staging": "vite build --mode staging",
"build:dev": "vite build --mode development", "build:dev": "vite build --mode development",
"preview": "vite preview", "preview": "vite preview",
"typecheck": "vue-tsc --noEmit --skipLibCheck" "typecheck": "vue-tsc --noEmit --skipLibCheck"

View File

@ -8,6 +8,10 @@
"dependsOn": ["@sy/web-vitals#build"], "dependsOn": ["@sy/web-vitals#build"],
"outputs": ["dist/**", "dist.zip"] "outputs": ["dist/**", "dist.zip"]
}, },
"build:staging": {
"dependsOn": ["@sy/web-vitals#build"],
"outputs": ["dist/**"]
},
"preview": { "preview": {
"dependsOn": ["@sy/web-vitals#build"], "dependsOn": ["@sy/web-vitals#build"],
"outputs": ["dist/**"] "outputs": ["dist/**"]

View File

@ -104,6 +104,14 @@ const customConfig: Linter.Config[] = [
], ],
}, },
}, },
{
// @core/shared内部组件不能引入@vben/* 或者 @vben-core/* 里面的包
files: ['packages/renderer-adapter/**/**'],
ignores: restrictedImportIgnores,
rules: {
'no-console': 'off',
},
},
{ {
// 不能引入@vben/*里面的包 // 不能引入@vben/*里面的包

View File

@ -16,6 +16,7 @@
"type": "module", "type": "module",
"scripts": { "scripts": {
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 turbo build", "build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 turbo build",
"build:staging": "cross-env NODE_OPTIONS=--max-old-space-size=8192 turbo run build:staging",
"build:analyze": "turbo build:analyze", "build:analyze": "turbo build:analyze",
"build:docker": "./scripts/deploy/build-local-docker-image.sh", "build:docker": "./scripts/deploy/build-local-docker-image.sh",
"build:docs": "pnpm run build --filter=@vben/docs", "build:docs": "pnpm run build --filter=@vben/docs",

View File

@ -5,15 +5,13 @@ import Postmate from 'postmate';
const props = defineProps<{ const props = defineProps<{
accessToken?: string; accessToken?: string;
applicationId: string; applicationId: number | string;
fileId: string; fileId: number | string;
name: string; name: string;
projectId: string; projectId: number | string;
url: string; url: string;
}>(); }>();
Console.log('props', props);
const initPostmate = async () => { const initPostmate = async () => {
const container = document.querySelector('#low-code-adapter'); const container = document.querySelector('#low-code-adapter');
if (!container) { if (!container) {
@ -38,6 +36,7 @@ const initPostmate = async () => {
connection.then((child) => { connection.then((child) => {
child.frame.style.height = '100%'; child.frame.style.height = '100%';
child.frame.style.width = '100%'; child.frame.style.width = '100%';
// @ts-ignore console
console.log(`${props.name} 连接成功`, child); console.log(`${props.name} 连接成功`, child);
child.call('child-connected', { child.call('child-connected', {
name: props.name, name: props.name,
@ -51,5 +50,21 @@ onMounted(() => {
</script> </script>
<template> <template>
<div id="low-code-adapter" style="width: 100%; height: 100%"></div> <div
id="low-code-adapter"
class="low-code-adapter"
style="width: 100%; height: 100%"
></div>
</template> </template>
<style scoped>
.low-code-adapter {
width: 100%;
}
.low-code-adapter iframe {
width: 100%;
height: 100%;
border: none;
}
</style>

22
pnpm-lock.yaml generated
View File

@ -494,7 +494,7 @@ catalogs:
version: 2.1.10 version: 2.1.10
vxe-pc-ui: vxe-pc-ui:
specifier: ^4.4.8 specifier: ^4.4.8
version: 4.4.9 version: 4.4.10
vxe-table: vxe-table:
specifier: 4.10.0 specifier: 4.10.0
version: 4.10.0 version: 4.10.0
@ -1842,7 +1842,7 @@ importers:
version: 3.5.13(typescript@5.8.2) version: 3.5.13(typescript@5.8.2)
vxe-pc-ui: vxe-pc-ui:
specifier: 'catalog:' specifier: 'catalog:'
version: 4.4.9(vue@3.5.13(typescript@5.8.2)) version: 4.4.10(vue@3.5.13(typescript@5.8.2))
vxe-table: vxe-table:
specifier: 'catalog:' specifier: 'catalog:'
version: 4.10.0(vue@3.5.13(typescript@5.8.2)) version: 4.10.0(vue@3.5.13(typescript@5.8.2))
@ -12646,8 +12646,8 @@ packages:
typescript: typescript:
optional: true optional: true
vxe-pc-ui@4.4.9: vxe-pc-ui@4.4.10:
resolution: {integrity: sha512-3GiU8DIkFxwOb36jmZLLqcTn+O/67KLc1FNmUnVDyjF6ZZhu59U8vVk8fX7523qZyjYPb/3U9666viCbphnkVA==} resolution: {integrity: sha512-DDVKOTOWUKMng/miV9YTDWcj4FYxBBmmsUKEpHk4fCuRvZjbGazfDhE/7Nxsu9/2J0y5tNotMxT1swizQiNNZw==}
vxe-table-plugin-menus@4.0.6: vxe-table-plugin-menus@4.0.6:
resolution: {integrity: sha512-340W2H58hC9Qatk05Yfnq1GTzjtqmnHH0i9PK/pOnwX65w102d/UtfHe9Ax0i3uYqsbg6JuMEn6Mjnnm+/U3bQ==} resolution: {integrity: sha512-340W2H58hC9Qatk05Yfnq1GTzjtqmnHH0i9PK/pOnwX65w102d/UtfHe9Ax0i3uYqsbg6JuMEn6Mjnnm+/U3bQ==}
@ -12994,8 +12994,8 @@ packages:
zwitch@2.0.4: zwitch@2.0.4:
resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==}
zx@8.4.0: zx@8.4.1:
resolution: {integrity: sha512-b5+gbUT0akQ5vVuBuHgp0viQx2ZYCuooVD41Z7g47sN0diLsAvB2XteHcp5lec90CNEQ9o7TkXsE3ksaJrZHGw==} resolution: {integrity: sha512-1Cb+Tfwt/daKV6wckBeDbB6h3IMauqj9KWp+EcbYzi9doeJeIHCktxp/yWspXOXRdoUzBCQSKoUgm3g8r9fz5A==}
engines: {node: '>= 12.17.0'} engines: {node: '>= 12.17.0'}
hasBin: true hasBin: true
@ -18478,7 +18478,7 @@ snapshots:
node-cleanup: 2.1.2 node-cleanup: 2.1.2
typescript: 5.8.2 typescript: 5.8.2
update-notifier: 7.3.1 update-notifier: 7.3.1
zx: 8.4.0 zx: 8.4.1
citty@0.1.6: citty@0.1.6:
dependencies: dependencies:
@ -19141,7 +19141,7 @@ snapshots:
dependencies: dependencies:
is-arguments: 1.2.0 is-arguments: 1.2.0
is-date-object: 1.1.0 is-date-object: 1.1.0
is-regex: 1.2.1 is-regex: 1.1.4
object-is: 1.1.6 object-is: 1.1.6
object-keys: 1.1.1 object-keys: 1.1.1
regexp.prototype.flags: 1.5.4 regexp.prototype.flags: 1.5.4
@ -25713,7 +25713,7 @@ snapshots:
optionalDependencies: optionalDependencies:
typescript: 5.8.2 typescript: 5.8.2
vxe-pc-ui@4.4.9(vue@3.5.13(typescript@5.8.2)): vxe-pc-ui@4.4.10(vue@3.5.13(typescript@5.8.2)):
dependencies: dependencies:
'@vxe-ui/core': 4.0.35(vue@3.5.13(typescript@5.8.2)) '@vxe-ui/core': 4.0.35(vue@3.5.13(typescript@5.8.2))
transitivePeerDependencies: transitivePeerDependencies:
@ -25725,7 +25725,7 @@ snapshots:
vxe-table@4.10.0(vue@3.5.13(typescript@5.8.2)): vxe-table@4.10.0(vue@3.5.13(typescript@5.8.2)):
dependencies: dependencies:
vxe-pc-ui: 4.4.9(vue@3.5.13(typescript@5.8.2)) vxe-pc-ui: 4.4.10(vue@3.5.13(typescript@5.8.2))
transitivePeerDependencies: transitivePeerDependencies:
- vue - vue
@ -26134,4 +26134,4 @@ snapshots:
zwitch@2.0.4: {} zwitch@2.0.4: {}
zx@8.4.0: {} zx@8.4.1: {}

View File

@ -19,7 +19,7 @@
"cache": false "cache": false
}, },
"build": { "build": {
"dependsOn": ["reinstall", "^build"], "dependsOn": ["^build"],
"outputs": [ "outputs": [
"dist/**", "dist/**",
"dist.zip", "dist.zip",
@ -31,6 +31,10 @@
"dependsOn": ["^build"], "dependsOn": ["^build"],
"outputs": ["dist/**"] "outputs": ["dist/**"]
}, },
"build:staging": {
"dependsOn": ["@sy/y-code-renderer#build:staging"],
"outputs": ["dist/**"]
},
"build:analyze": { "build:analyze": {
"dependsOn": ["^build"], "dependsOn": ["^build"],
"outputs": ["dist/**"] "outputs": ["dist/**"]

View File

@ -2,171 +2,175 @@
"folders": [ "folders": [
{ {
"name": "@sy/y-code-designer", "name": "@sy/y-code-designer",
"path": "apps/designer" "path": "apps/designer",
},
{
"name": "@sy/y-code-platform",
"path": "apps/platform"
},
{
"name": "@sy/y-code-renderer",
"path": "apps/renderer"
},
{
"name": "@sy/low-code-y-code-v1",
"path": "apps/y-code-v1"
}, },
{ {
"name": "@sy/y-code-docs", "name": "@sy/y-code-docs",
"path": "apps/docs" "path": "apps/docs",
},
{
"name": "@sy/y-code-platform",
"path": "apps/platform",
},
{
"name": "@sy/y-code-renderer",
"path": "apps/renderer",
},
{
"name": "@sy/low-code-y-code-v1",
"path": "apps/y-code-v1",
}, },
{ {
"name": "@vben/commitlint-config", "name": "@vben/commitlint-config",
"path": "internal/lint-configs/commitlint-config" "path": "internal/lint-configs/commitlint-config",
}, },
{ {
"name": "@vben/eslint-config", "name": "@vben/eslint-config",
"path": "internal/lint-configs/eslint-config" "path": "internal/lint-configs/eslint-config",
}, },
{ {
"name": "@vben/prettier-config", "name": "@vben/prettier-config",
"path": "internal/lint-configs/prettier-config" "path": "internal/lint-configs/prettier-config",
}, },
{ {
"name": "@vben/stylelint-config", "name": "@vben/stylelint-config",
"path": "internal/lint-configs/stylelint-config" "path": "internal/lint-configs/stylelint-config",
}, },
{ {
"name": "@vben/node-utils", "name": "@vben/node-utils",
"path": "internal/node-utils" "path": "internal/node-utils",
}, },
{ {
"name": "@vben/tailwind-config", "name": "@vben/tailwind-config",
"path": "internal/tailwind-config" "path": "internal/tailwind-config",
}, },
{ {
"name": "@vben/tsconfig", "name": "@vben/tsconfig",
"path": "internal/tsconfig" "path": "internal/tsconfig",
}, },
{ {
"name": "@vben/vite-config", "name": "@vben/vite-config",
"path": "internal/vite-config" "path": "internal/vite-config",
}, },
{ {
"name": "@vben-core/design", "name": "@vben-core/design",
"path": "packages/@core/base/design" "path": "packages/@core/base/design",
}, },
{ {
"name": "@vben-core/icons", "name": "@vben-core/icons",
"path": "packages/@core/base/icons" "path": "packages/@core/base/icons",
}, },
{ {
"name": "@vben-core/shared", "name": "@vben-core/shared",
"path": "packages/@core/base/shared" "path": "packages/@core/base/shared",
}, },
{ {
"name": "@vben-core/typings", "name": "@vben-core/typings",
"path": "packages/@core/base/typings" "path": "packages/@core/base/typings",
}, },
{ {
"name": "@vben-core/composables", "name": "@vben-core/composables",
"path": "packages/@core/composables" "path": "packages/@core/composables",
}, },
{ {
"name": "@vben-core/preferences", "name": "@vben-core/preferences",
"path": "packages/@core/preferences" "path": "packages/@core/preferences",
}, },
{ {
"name": "@vben-core/form-ui", "name": "@vben-core/form-ui",
"path": "packages/@core/ui-kit/form-ui" "path": "packages/@core/ui-kit/form-ui",
}, },
{ {
"name": "@vben-core/layout-ui", "name": "@vben-core/layout-ui",
"path": "packages/@core/ui-kit/layout-ui" "path": "packages/@core/ui-kit/layout-ui",
}, },
{ {
"name": "@vben-core/menu-ui", "name": "@vben-core/menu-ui",
"path": "packages/@core/ui-kit/menu-ui" "path": "packages/@core/ui-kit/menu-ui",
}, },
{ {
"name": "@vben-core/popup-ui", "name": "@vben-core/popup-ui",
"path": "packages/@core/ui-kit/popup-ui" "path": "packages/@core/ui-kit/popup-ui",
}, },
{ {
"name": "@vben-core/shadcn-ui", "name": "@vben-core/shadcn-ui",
"path": "packages/@core/ui-kit/shadcn-ui" "path": "packages/@core/ui-kit/shadcn-ui",
}, },
{ {
"name": "@vben-core/tabs-ui", "name": "@vben-core/tabs-ui",
"path": "packages/@core/ui-kit/tabs-ui" "path": "packages/@core/ui-kit/tabs-ui",
}, },
{ {
"name": "@vben/constants", "name": "@vben/constants",
"path": "packages/constants" "path": "packages/constants",
}, },
{ {
"name": "@vben/access", "name": "@vben/access",
"path": "packages/effects/access" "path": "packages/effects/access",
}, },
{ {
"name": "@vben/common-ui", "name": "@vben/common-ui",
"path": "packages/effects/common-ui" "path": "packages/effects/common-ui",
}, },
{ {
"name": "@vben/hooks", "name": "@vben/hooks",
"path": "packages/effects/hooks" "path": "packages/effects/hooks",
}, },
{ {
"name": "@vben/layouts", "name": "@vben/layouts",
"path": "packages/effects/layouts" "path": "packages/effects/layouts",
}, },
{ {
"name": "@vben/plugins", "name": "@vben/plugins",
"path": "packages/effects/plugins" "path": "packages/effects/plugins",
}, },
{ {
"name": "@vben/request", "name": "@vben/request",
"path": "packages/effects/request" "path": "packages/effects/request",
}, },
{ {
"name": "@vben/icons", "name": "@vben/icons",
"path": "packages/icons" "path": "packages/icons",
}, },
{ {
"name": "@vben/locales", "name": "@vben/locales",
"path": "packages/locales" "path": "packages/locales",
}, },
{ {
"name": "@vben/preferences", "name": "@vben/preferences",
"path": "packages/preferences" "path": "packages/preferences",
},
{
"name": "@sy/vue3-renderer-adapter",
"path": "packages/renderer-adapter/vue3",
}, },
{ {
"name": "@vben/stores", "name": "@vben/stores",
"path": "packages/stores" "path": "packages/stores",
}, },
{ {
"name": "@vben/styles", "name": "@vben/styles",
"path": "packages/styles" "path": "packages/styles",
}, },
{ {
"name": "@vben/types", "name": "@vben/types",
"path": "packages/types" "path": "packages/types",
}, },
{ {
"name": "@vben/utils", "name": "@vben/utils",
"path": "packages/utils" "path": "packages/utils",
}, },
{ {
"name": "@sy/web-vitals", "name": "@sy/web-vitals",
"path": "packages/web-vitals" "path": "packages/web-vitals",
}, },
{ {
"name": "@vben/turbo-run", "name": "@vben/turbo-run",
"path": "scripts/turbo-run" "path": "scripts/turbo-run",
}, },
{ {
"name": "@vben/vsh", "name": "@vben/vsh",
"path": "scripts/vsh" "path": "scripts/vsh",
} },
] ],
} }