From 6f9ca930323a0529d90aeda8af694ff3d6155cbb Mon Sep 17 00:00:00 2001 From: tyh666999 <1469442737@qq.com> Date: Sun, 8 Oct 2023 13:58:15 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E5=BA=9F=E9=99=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fighting-resolver/LICENSE | 21 ----------- packages/fighting-resolver/README.md | 36 ------------------- packages/fighting-resolver/index.ts | 46 ------------------------ packages/fighting-resolver/package.json | 12 ------- packages/fighting-resolver/tsconfig.json | 18 ---------- 5 files changed, 133 deletions(-) delete mode 100644 packages/fighting-resolver/LICENSE delete mode 100644 packages/fighting-resolver/README.md delete mode 100644 packages/fighting-resolver/index.ts delete mode 100644 packages/fighting-resolver/package.json delete mode 100644 packages/fighting-resolver/tsconfig.json diff --git a/packages/fighting-resolver/LICENSE b/packages/fighting-resolver/LICENSE deleted file mode 100644 index b754b5238b..0000000000 --- a/packages/fighting-resolver/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Tyh2001 (田同学) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/fighting-resolver/README.md b/packages/fighting-resolver/README.md deleted file mode 100644 index 6a5b2ebdc4..0000000000 --- a/packages/fighting-resolver/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# @fighting-design/fighting-resolver - -用于 [unplugin-vue-components](https://github.com/antfu/unplugin-vue-components) 的导入配置 - -## 自动导入 - -首先你需要安装 unplugin-vue-components 和 unplugin-auto-import 这两款插件 - -```node -npm install -D unplugin-vue-components unplugin-auto-import -``` - -然后把下列代码插入到你的 Vite 或 Webpack 的配置文件中 - -### vite - -```js -// vite.config.ts -import { defineConfig } from 'vite' -import AutoImport from 'unplugin-auto-import/vite' // 自动注入api -import Components from 'unplugin-vue-components/vite' // 自动注册组件 -import { FightingDesignResolver } from '@fighting-design/fighting-resolver' - -export default defineConfig({ - // ... - plugins: [ - // ... - AutoImport({ - resolvers: [FightingDesignResolver()] - }), - Components({ - resolvers: [FightingDesignResolver()] - }) - ] -}) -``` diff --git a/packages/fighting-resolver/index.ts b/packages/fighting-resolver/index.ts deleted file mode 100644 index 2e51049501..0000000000 --- a/packages/fighting-resolver/index.ts +++ /dev/null @@ -1,46 +0,0 @@ -// import { existsSync } from 'fs' - -// const setWebComponentName = ( -// name: string -// ): string => { -// /** -// * 区分F、f- -// */ -// if (name.includes('F')) { -// const result = name.slice(1).replace(/([A-Z])/g, ' $1').trim() -// return result.split(' ').join('-').toLowerCase() -// } else if (name.includes('f-')) { -// return name.slice(2) -// } -// return '' -// } - -// interface ResolveReturnInterface { -// name: string -// from: string -// sideEffects: string[] -// } - -// function FightingDesignResolver(): { -// type: string, -// resolve: (name: string) => ResolveReturnInterface | undefined -// } -// function FightingDesignResolver () { -// return { -// type: 'component', -// resolve: (name: string) => { -// if (name.match(/^(F[A-Z]|f-[a-z])/)) { -// const cssPath = `fighting-design/theme/${setWebComponentName(name)}.css` -// const sideEffects = existsSync(cssPath) ? [cssPath] : [] - -// return { -// name, -// sideEffects, -// from: 'fighting-design' -// } -// } -// } -// } -// } - -// export default FightingDesignResolver diff --git a/packages/fighting-resolver/package.json b/packages/fighting-resolver/package.json deleted file mode 100644 index bc60ffa708..0000000000 --- a/packages/fighting-resolver/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "@fighting-design/fighting-resolver", - "version": "1.0.0", - "description": "Configuration item for unplugin-vue-components", - "main": "index", - "module": "index", - "types": "index.d.ts", - "scripts": { - "build": "tsc" - }, - "license": "MIT" -} diff --git a/packages/fighting-resolver/tsconfig.json b/packages/fighting-resolver/tsconfig.json deleted file mode 100644 index 6dcf691507..0000000000 --- a/packages/fighting-resolver/tsconfig.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "compilerOptions": { - "target": "esnext", - "outDir": "../../dist/resolver", - "useDefineForClassFields": true, - "module": "CommonJS", - "moduleResolution": "node", - "strict": true, - "sourceMap": false, - "resolveJsonModule": true, - "isolatedModules": true, - "esModuleInterop": true, - "declaration": true, - "lib": ["esnext"], - "skipLibCheck": true - }, - "include": ["index.ts"] -}