Skip to content

Commit

Permalink
docs: 删除smb配置以及相关依赖 (#2332)
Browse files Browse the repository at this point in the history
  • Loading branch information
gimmyhehe authored Oct 21, 2024
1 parent 455332c commit 71bbf49
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 67 deletions.
6 changes: 2 additions & 4 deletions examples/docs/newsrc/pc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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')
Expand Down
1 change: 0 additions & 1 deletion examples/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:~",
Expand Down
1 change: 0 additions & 1 deletion examples/sites/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:~",
Expand Down
17 changes: 8 additions & 9 deletions examples/sites/playground/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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`
}
Expand Down Expand Up @@ -132,8 +132,7 @@ const state = reactive({
const designThemeMap = {
aurora: 'tinyAuroraTheme',
infinity: 'tinyInfinityTheme',
smb: 'tinySmbTheme'
infinity: 'tinyInfinityTheme'
}
function setTinyDesign() {
Expand All @@ -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`
Expand Down
9 changes: 4 additions & 5 deletions examples/sites/src/tools/useTheme.js
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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()
Expand Down
23 changes: 11 additions & 12 deletions examples/vue2/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "vue2-example",
"type": "module",
"private": true,
"version": "0.1.6-mf.0",
"private": true,
"files": [
"*"
],
Expand All @@ -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",
Expand All @@ -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"
}
}
}
1 change: 0 additions & 1 deletion examples/vue3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:~",
Expand Down
12 changes: 2 additions & 10 deletions internals/cli/src/commands/build/build-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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
}

Expand Down
7 changes: 1 addition & 6 deletions internals/cli/src/commands/create/commonMapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -59,4 +54,4 @@
"type": "template",
"exclude": false
}
}
}
7 changes: 0 additions & 7 deletions packages/design/smb/index.ts

This file was deleted.

11 changes: 0 additions & 11 deletions packages/design/smb/package.json

This file was deleted.

0 comments on commit 71bbf49

Please sign in to comment.