chore: 完善依赖

This commit is contained in:
roymondchen 2024-05-14 14:25:47 +08:00
parent 5074c9e68b
commit 901fe4dd94
23 changed files with 60 additions and 69 deletions

View File

@ -18,7 +18,7 @@ https://tencent.github.io/tmagic-editor/playground/index.html
node.js >= 18
pnpm >= 8
pnpm >= 9
先安装 pnpm

View File

@ -38,12 +38,14 @@
"vue"
],
"dependencies": {
"@tmagic/data-source": "workspace:*",
"@tmagic/schema": "workspace:*",
"@tmagic/utils": "workspace:*",
"events": "^3.3.0",
"lodash-es": "^4.17.21"
},
"peerDependencies": {
"@tmagic/data-source": "workspace:*",
"@tmagic/schema": "workspace:*",
"@tmagic/utils": "workspace:*"
},
"devDependencies": {
"@types/events": "^3.0.0",
"@types/lodash-es": "^4.17.4",

View File

@ -48,7 +48,10 @@ export default defineConfig({
rollupOptions: {
// 确保外部化处理那些你不想打包进库的依赖
external(id: string) {
return Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id));
return Object.keys({
...pkg.dependencies,
...pkg.peerDependencies,
}).some((k) => new RegExp(`^${k}`).test(id));
},
},
},

View File

@ -35,12 +35,14 @@
],
"dependencies": {
"@tmagic/dep": "workspace:*",
"@tmagic/schema": "workspace:*",
"@tmagic/utils": "workspace:*",
"deep-state-observer": "^5.5.13",
"events": "^3.3.0",
"lodash-es": "^4.17.21"
},
"peerDependencies": {
"@tmagic/schema": "workspace:*",
"@tmagic/utils": "workspace:*"
},
"devDependencies": {
"@types/events": "^3.0.0",
"@types/lodash-es": "^4.17.4",

View File

@ -52,7 +52,10 @@ export default defineConfig(({ mode }) => ({
if (mode === 'umd' && id === 'lodash-es') {
return false;
}
return Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id));
return Object.keys({
...pkg.dependencies,
...pkg.peerDependencies,
}).some((k) => new RegExp(`^${k}`).test(id));
},
},
},

View File

@ -30,7 +30,7 @@
"type": "git",
"url": "https://github.com/Tencent/tmagic-editor.git"
},
"dependencies": {
"peerDependencies": {
"@tmagic/schema": "workspace:*",
"@tmagic/utils": "workspace:*"
},

View File

@ -44,7 +44,7 @@ export default defineConfig({
rollupOptions: {
// 确保外部化处理那些你不想打包进库的依赖
external(id: string) {
return Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id));
return Object.keys(pkg.peerDependencies).some((k) => new RegExp(`^${k}`).test(id));
},
},
},

View File

@ -37,9 +37,6 @@
"vue3",
"typescript"
],
"dependencies": {
"vue": "^3.4.27"
},
"peerDependencies": {
"vue": "^3.4.27"
},

View File

@ -47,7 +47,7 @@ export default defineConfig({
rollupOptions: {
// 确保外部化处理那些你不想打包进库的依赖
external(id: string) {
return Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id));
return Object.keys(pkg.peerDependencies).some((k) => new RegExp(`^${k}`).test(id));
},
output: {

View File

@ -47,14 +47,8 @@
],
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
"@tmagic/core": "workspace:*",
"@tmagic/dep": "workspace:*",
"@tmagic/design": "workspace:*",
"@tmagic/form": "workspace:*",
"@tmagic/schema": "workspace:*",
"@tmagic/stage": "workspace:*",
"@tmagic/table": "workspace:*",
"@tmagic/utils": "workspace:*",
"buffer": "^6.0.3",
"color": "^3.1.3",
"emmet-monaco-es": "^5.3.0",
@ -62,14 +56,16 @@
"gesto": "^1.19.1",
"keycon": "^1.4.0",
"lodash-es": "^4.17.21",
"monaco-editor": "^0.48.0",
"moveable": "^0.53.0",
"serialize-javascript": "^6.0.0",
"vue": "^3.4.27"
"serialize-javascript": "^6.0.0"
},
"peerDependencies": {
"@tmagic/core": "workspace:*",
"@tmagic/design": "workspace:*",
"@tmagic/form": "workspace:*",
"@tmagic/schema": "workspace:*",
"@tmagic/stage": "workspace:*",
"@tmagic/utils": "workspace:*",
"monaco-editor": "^0.48.0",
"vue": "^3.4.27"
},

View File

@ -63,7 +63,10 @@ export default defineConfig({
rollupOptions: {
// 确保外部化处理那些你不想打包进库的依赖
external(id: string) {
return Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id));
return Object.keys({
...pkg.dependencies,
...pkg.peerDependencies,
}).some((k) => new RegExp(`^${k}`).test(id));
},
output: {

View File

@ -37,10 +37,6 @@
"vue3",
"typescript"
],
"dependencies": {
"@tmagic/design": "workspace:*",
"element-plus": "^2.6.1"
},
"peerDependencies": {
"@tmagic/design": "workspace:*",
"element-plus": "^2.6.1"

View File

@ -35,7 +35,7 @@ export default defineConfig({
rollupOptions: {
// 确保外部化处理那些你不想打包进库的依赖
external(id: string) {
return Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id));
return Object.keys(pkg.peerDependencies).some((k) => new RegExp(`^${k}`).test(id));
},
},
},

View File

@ -38,13 +38,12 @@
},
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
"@tmagic/design": "workspace:*",
"@tmagic/utils": "workspace:*",
"lodash-es": "^4.17.21",
"sortablejs": "^1.15.2",
"vue": "^3.4.27"
"sortablejs": "^1.15.2"
},
"peerDependencies": {
"@tmagic/design": "workspace:*",
"@tmagic/utils": "workspace:*",
"vue": "^3.4.27"
},
"devDependencies": {

View File

@ -51,12 +51,10 @@ export default defineConfig({
rollupOptions: {
// 确保外部化处理那些你不想打包进库的依赖
external(id: string) {
return (
/^vue/.test(id) ||
/^element-plus/.test(id) ||
/^@tmagic\//.test(id) ||
Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id))
);
return Object.keys({
...pkg.dependencies,
...pkg.peerDependencies,
}).some((k) => new RegExp(`^${k}`).test(id));
},
output: {

View File

@ -32,15 +32,17 @@
},
"dependencies": {
"@scena/guides": "^0.29.2",
"@tmagic/core": "workspace:*",
"@tmagic/schema": "workspace:*",
"@tmagic/utils": "workspace:*",
"events": "^3.3.0",
"keycon": "^1.4.0",
"lodash-es": "^4.17.21",
"moveable": "^0.53.0",
"moveable-helper": "^0.4.0"
},
"peerDependencies": {
"@tmagic/core": "workspace:*",
"@tmagic/schema": "workspace:*",
"@tmagic/utils": "workspace:*"
},
"devDependencies": {
"@types/events": "^3.0.0",
"@types/lodash-es": "^4.17.4",

View File

@ -49,11 +49,10 @@ export default defineConfig({
rollupOptions: {
// 确保外部化处理那些你不想打包进库的依赖
external(id: string) {
return (
/^vue/.test(id) ||
/^@tmagic\//.test(id) ||
Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id))
);
return Object.keys({
...pkg.dependencies,
...pkg.peerDependencies,
}).some((k) => new RegExp(`^${k}`).test(id));
},
},
},

View File

@ -35,14 +35,12 @@
"url": "https://github.com/Tencent/tmagic-editor.git"
},
"dependencies": {
"lodash-es": "^4.17.21"
},
"peerDependencies": {
"@tmagic/design": "workspace:*",
"@tmagic/form": "workspace:*",
"@tmagic/utils": "workspace:*",
"lodash-es": "^4.17.21",
"vue": "^3.4.27"
},
"peerDependencies": {
"@tmagic/form": "workspace:*",
"vue": "^3.4.27"
},
"devDependencies": {

View File

@ -51,12 +51,10 @@ export default defineConfig({
rollupOptions: {
// 确保外部化处理那些你不想打包进库的依赖
external(id: string) {
return (
/^vue/.test(id) ||
/^element-plus/.test(id) ||
/^@tmagic\//.test(id) ||
Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id))
);
return Object.keys({
...pkg.dependencies,
...pkg.peerDependencies,
}).some((k) => new RegExp(`^${k}`).test(id));
},
output: {

View File

@ -37,11 +37,6 @@
"vue3",
"typescript"
],
"dependencies": {
"@tmagic/design": "workspace:*",
"tdesign-vue-next": "^1.8.1",
"vue": "^3.4.27"
},
"peerDependencies": {
"@tmagic/design": "workspace:*",
"tdesign-vue-next": "^1.8.1",

View File

@ -38,7 +38,7 @@ export default defineConfig({
rollupOptions: {
// 确保外部化处理那些你不想打包进库的依赖
external(id: string) {
return Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id));
return Object.keys(pkg.peerDependencies).some((k) => new RegExp(`^${k}`).test(id));
},
},
},

View File

@ -31,12 +31,11 @@
"url": "https://github.com/Tencent/tmagic-editor.git"
},
"dependencies": {
"@tmagic/schema": "workspace:*",
"dayjs": "^1.11.11",
"lodash-es": "^4.17.21"
},
"peerDependencies": {
"dayjs": "^1.11.11"
"@tmagic/schema": "workspace:*"
},
"devDependencies": {
"@types/lodash-es": "^4.17.4",

View File

@ -20,8 +20,6 @@ import { defineConfig, type LibraryFormats } from 'vite';
import pkg from './package.json';
const deps = Object.keys(pkg.dependencies);
export default defineConfig(({ mode }) => ({
build: {
cssCodeSplit: false,
@ -43,7 +41,10 @@ export default defineConfig(({ mode }) => ({
if (mode === 'umd' && id === 'lodash-es') {
return false;
}
return deps.some((k) => new RegExp(`^${k}`).test(id));
return Object.keys({
...pkg.dependencies,
...pkg.peerDependencies,
}).some((k) => new RegExp(`^${k}`).test(id));
},
},
},