docs: 删除smb配置以及相关依赖 (#2332)

This commit is contained in:
gimmyhehe 2024-10-21 16:51:41 +08:00 committed by GitHub
parent 455332c8bd
commit 71bbf49a36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 28 additions and 67 deletions

View File

@ -157,7 +157,6 @@ import {
} from '@opentiny/vue'
import { iconStarActive, iconSelect } from '@opentiny/vue-icon'
import Loading from '@opentiny/vue-loading'
import designSmbConfig from '@opentiny/vue-design-smb'
import designSaasConfig from '@opentiny/vue-design-saas'
import { menuData, demoStr, demoVue, mds, demos } from './resourcePc.js'
import { useTheme, useModeCtx } from './uses'
@ -263,10 +262,9 @@ export default {
modeFn.pushToUrl()
}
// 使designSmbConfig
const designConfigMap = {
'tiny-smb-theme': designSmbConfig,
'tiny-aurora-theme': designSmbConfig
'tiny-smb-theme': {},
'tiny-aurora-theme': {}
}
const lastThemeKey = localStorage.getItem('tinyThemeToolkey')

View File

@ -14,7 +14,6 @@
"@opentiny/vue-common": "workspace:~",
"@opentiny/vue-design-aurora": "workspace:~",
"@opentiny/vue-design-saas": "workspace:~",
"@opentiny/vue-design-smb": "workspace:~",
"@opentiny/vue-icon": "workspace:~",
"@opentiny/vue-theme-mobile": "workspace:~",
"@opentiny/vue-theme-saas": "workspace:~",

View File

@ -25,7 +25,6 @@
"@opentiny/vue-common": "workspace:~",
"@opentiny/vue-design-aurora": "workspace:~",
"@opentiny/vue-design-saas": "workspace:~",
"@opentiny/vue-design-smb": "workspace:~",
"@opentiny/vue-directive": "workspace:~",
"@opentiny/vue-hooks": "workspace:~",
"@opentiny/vue-icon": "workspace:~",

View File

@ -71,9 +71,10 @@ const createImportMap = (version) => {
'@opentiny/vue-renderless/': `${cdnHost}/@opentiny/vue-renderless${versionDelimiter}${version}/${fileDelimiter}`,
'sortablejs': `${cdnHost}/sortablejs${versionDelimiter}1.15.0/${fileDelimiter}modular/sortable.esm.js`
}
if (['aurora', 'smb', 'saas'].includes(tinyTheme)) {
imports[`@opentiny/vue-design-${tinyTheme}`] =
`${cdnHost}/@opentiny/vue-design-${tinyTheme}${versionDelimiter}${version}/${fileDelimiter}index.js`
if (['aurora', 'saas'].includes(tinyTheme)) {
imports[
`@opentiny/vue-design-${tinyTheme}`
] = `${cdnHost}/@opentiny/vue-design-${tinyTheme}${versionDelimiter}${version}/${fileDelimiter}index.js`
}
if (isSaas) {
imports['@opentiny/vue-icon'] = `${getRuntime(version)}tiny-vue-icon-saas.mjs`
@ -88,12 +89,11 @@ const getTinyTheme = (version) => {
return `${getRuntime(version)}tailwind.css`
}
let theme = tinyTheme
if (!['smb', 'default', 'aurora', 'saas'].includes(theme)) {
if (!['aurora', 'saas'].includes(theme)) {
theme = 'default'
}
const tinyThemeMap = {
default: `${cdnHost}/@opentiny/vue-theme${versionDelimiter}${version}/${fileDelimiter}index.css`,
smb: `${cdnHost}/@opentiny/vue-theme${versionDelimiter}${version}/${fileDelimiter}index.css`,
aurora: `${cdnHost}/@opentiny/vue-theme${versionDelimiter}${version}/${fileDelimiter}index.css`,
saas: `${cdnHost}/@opentiny/vue-theme-saas${versionDelimiter}${version}/${fileDelimiter}index.css`
}
@ -132,8 +132,7 @@ const state = reactive({
const designThemeMap = {
aurora: 'tinyAuroraTheme',
infinity: 'tinyInfinityTheme',
smb: 'tinySmbTheme'
infinity: 'tinyInfinityTheme'
}
function setTinyDesign() {
@ -144,13 +143,13 @@ function setTinyDesign() {
useCode += 'app.provide("TinyMode", "mobile-first");\n'
}
if (['aurora', 'smb', 'saas'].includes(tinyTheme)) {
if (['aurora', 'saas'].includes(tinyTheme)) {
importCode += `import designConfig from '@opentiny/vue-design-${tinyTheme}';
import { design } from '@opentiny/vue-common';\n`
useCode += 'app.provide(design.configKey, designConfig);\n'
}
if (['aurora', 'infinity', 'smb'].includes(tinyTheme)) {
if (['aurora', 'infinity'].includes(tinyTheme)) {
const designTheme = designThemeMap[tinyTheme]
importCode += `import TinyThemeTool from '@opentiny/vue-theme/theme-tool';
import { ${designTheme} } from '@opentiny/vue-theme/theme';\n`

View File

@ -1,7 +1,6 @@
import { watch, computed } from 'vue'
import TinyThemeTool from '@opentiny/vue-theme/theme-tool'
import { hooks } from '@opentiny/vue-common'
import designSmbConfig from '@opentiny/vue-design-smb'
import designSaasConfig from '@opentiny/vue-design-saas'
import { router } from '@/router'
import { appData } from './appData'
@ -67,10 +66,10 @@ const themeData = [
]
const designConfigMap = {
[DEFAULT_THEME]: designSmbConfig,
[INFINITY_THEME]: designSmbConfig,
[AURORA_THEME]: designSmbConfig,
[SMB_THEME]: designSmbConfig
[DEFAULT_THEME]: {},
[INFINITY_THEME]: {},
[AURORA_THEME]: {},
[SMB_THEME]: {}
}
const theme = new TinyThemeTool()

View File

@ -1,8 +1,8 @@
{
"name": "vue2-example",
"type": "module",
"private": true,
"version": "0.1.6-mf.0",
"private": true,
"files": [
"*"
],
@ -23,21 +23,27 @@
"@opentiny/vue-locale": "workspace:~",
"@opentiny/vue-renderless": "workspace:~",
"@opentiny/vue-theme": "workspace:~",
"@opentiny/vue-theme-saas": "workspace:~",
"@opentiny/vue-theme-mobile": "workspace:~",
"@opentiny/vue-theme-saas": "workspace:~",
"@opentiny/vue-vite-import": "workspace:~",
"@opentiny/vue-design-smb": "workspace:~",
"@playwright/test": "~1.42.0",
"@tiptap/vue-2": "^2.1.0",
"@unocss/core": "^0.48.0",
"@unocss/preset-icons": "^0.61.9",
"@unocss/transformer-directives": "^0.48.0",
"@vitest/ui": "^0.31.0",
"@vue/babel-helper-vue-jsx-merge-props": "^1.4.0",
"@vue/composition-api": "1.7.2",
"@vue/runtime-dom": "^3.2.31",
"@vue/test-utils": "^1.3.3",
"js-sha256": "^0.9.0",
"jsdom": "^21.0.0",
"onigasm": "^2.2.5",
"postcss": "^8.4.16",
"tailwindcss": "^3.2.4",
"tailwindcss-vite-plugin": "^0.0.3",
"typescript": "^5.0.0",
"unocss": "^0.61.9",
"unplugin-vue2-script-setup": "^0.11.3",
"vite": "^4.3.8",
"vite-plugin-checker": "^0.5.2",
@ -51,13 +57,6 @@
"vue": "2.6.14",
"vue-i18n": "^8.9.0",
"vue-template-compiler": "2.6.14",
"vue-tsc": "^1.0.16",
"js-sha256": "^0.9.0",
"onigasm": "^2.2.5",
"@tiptap/vue-2": "^2.1.0",
"unocss": "^0.61.9",
"@unocss/core": "^0.48.0",
"@unocss/preset-icons": "^0.61.9",
"@unocss/transformer-directives": "^0.48.0"
"vue-tsc": "^1.0.16"
}
}
}

View File

@ -22,7 +22,6 @@
"@opentiny/vue": "workspace:~",
"@opentiny/vue-common": "workspace:~",
"@opentiny/vue-design-aurora": "workspace:~",
"@opentiny/vue-design-smb": "workspace:~",
"@opentiny/vue-icon": "workspace:~",
"@opentiny/vue-locale": "workspace:~",
"@opentiny/vue-renderless": "workspace:~",

View File

@ -200,15 +200,7 @@ export const getBaseConfig = ({ vueVersion, dtsInclude, dts, buildTarget, isRunt
dependencies['@vue/composition-api'] = '1.7.2'
}
const matchList = [
'vue-icon',
'vue-icon-saas',
'vue',
'design/smb',
'design/aurora',
'design/saas',
'vue-directive'
]
const matchList = ['vue-icon', 'vue-icon-saas', 'vue', 'design/aurora', 'design/saas', 'vue-directive']
// 如果是主入口、svg图标或者主题规范包则直接指向相同路径
if (matchList.includes(filePath)) {
@ -334,7 +326,7 @@ async function batchBuildAll({ vueVersion, tasks, formats, message, emptyOutDir,
}
// design包不排除png文件
if (/design\/(saas|aurora|smb|)/.test(importer) && /\.png/.test(source)) {
if (/design\/(saas|aurora|)/.test(importer) && /\.png/.test(source)) {
return false
}

View File

@ -24,11 +24,6 @@
"type": "module",
"exclude": false
},
"DesignSmb": {
"path": "design/smb/index.ts",
"type": "module",
"exclude": false
},
"DesignAurora": {
"path": "design/aurora/index.ts",
"type": "module",
@ -59,4 +54,4 @@
"type": "template",
"exclude": false
}
}
}

View File

@ -1,7 +0,0 @@
import { version } from './package.json'
export default {
name: 'smb',
version,
components: {}
}

View File

@ -1,11 +0,0 @@
{
"name": "@opentiny/vue-design-smb",
"version": "3.18.0",
"sideEffects": false,
"type": "module",
"main": "index.ts",
"dependencies": {
"@opentiny/vue-icon": "workspace:~"
},
"license": "MIT"
}