From de13c95fbb7fa72bfae4c43fb2e264e2dd230aba Mon Sep 17 00:00:00 2001 From: xuqingkai Date: Wed, 2 Aug 2023 18:39:26 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=9A=80=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 2 +- .versionrc | 64 +++++++++++++++++ algolia.json | 16 ----- build/changelog.js | 22 ++++++ build/release.js | 80 +++++++++++++++++++++ commitlint.config.js | 2 +- package.json | 4 +- src/env.d.ts | 2 +- src/shime-uni.d.ts | 2 +- src/types.d.ts | 11 --- src/uni_modules/wot-design-uni/package.json | 2 +- src/uni_modules/wot-design-uni/readme.md | 55 +++++++++++++- tsconfig.types.json | 15 ---- vite.config.ts | 2 +- 14 files changed, 228 insertions(+), 51 deletions(-) create mode 100644 .versionrc delete mode 100644 algolia.json create mode 100644 build/changelog.js create mode 100644 build/release.js delete mode 100644 src/types.d.ts delete mode 100644 tsconfig.types.json diff --git a/.eslintrc.js b/.eslintrc.js index 18907349..584cd6e0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -4,7 +4,7 @@ * @LastEditTime: 2023-03-28 16:52:32 * @LastEditors: weisheng * @Description: - * @FilePath: \fant-mini-plus\.eslintrc.js + * @FilePath: \wot-design-uni\.eslintrc.js * 记得注释 */ module.exports = { diff --git a/.versionrc b/.versionrc new file mode 100644 index 00000000..d2e3b3dc --- /dev/null +++ b/.versionrc @@ -0,0 +1,64 @@ +{ + "header": "# 更新日志 \n\n", + "types": [{ + "type": "feat", + "section": "✨ Features | 新功能", + "hidden": false + }, + { + "type": "fix", + "section": "🐛 Bug Fixes | Bug 修复", + "hidden": false + }, + { + "type": "init", + "section": "🎉 Init | 初始化", + "hidden": true + }, + { + "type": "docs", + "section": "✏️ Documentation | 文档", + "hidden": true + }, + { + "type": "style", + "section": "💄 Styles | 风格", + "hidden": true + }, + { + "type": "refactor", + "section": "♻️ Code Refactoring | 代码重构", + "hidden": true + }, + { + "type": "perf", + "section": "⚡ Performance Improvements | 性能优化", + "hidden": true + }, + { + "type": "test", + "section": "✅ Tests | 测试", + "hidden": true + }, + { + "type": "revert", + "section": "⏪ Revert | 回退", + "hidden": true + }, + { + "type": "build", + "section": "📦‍ Build System | 打包构建", + "hidden": true + }, + { + "type": "chore", + "section": "🚀 Chore | 构建/工程依赖/工具", + "hidden": true + }, + { + "type": "ci", + "section": "👷 Continuous Integration | CI 配置", + "hidden": true + } + ] +} \ No newline at end of file diff --git a/algolia.json b/algolia.json deleted file mode 100644 index b8f46ea5..00000000 --- a/algolia.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "index_name": "wot-design-uni", - "start_urls": ["https://wot-design-uni.netlify.app/"], - "selectors": { - "lvl0": { - "selector": "", - "defaultValue": "Documentation" - }, - "lvl1": ".content h1", - "lvl2": ".content h2", - "lvl3": ".content h3", - "lvl4": ".content h4", - "lvl5": ".content h5", - "content": ".content p, .content li" - } -} diff --git a/build/changelog.js b/build/changelog.js new file mode 100644 index 00000000..7ef9191e --- /dev/null +++ b/build/changelog.js @@ -0,0 +1,22 @@ +/* + * @Author: weisheng + * @Date: 2022-02-24 15:37:04 + * @LastEditTime: 2023-08-02 17:52:00 + * @LastEditors: weisheng + * @Description: 讲生成的changelog移动到文档和组件中 + * @FilePath: \wot-design-uni\build\changelog.js + * 记得注释 + */ +const fs = require('fs') +const path = require('path') +const fromPath = path.resolve(__dirname, '../CHANGELOG.md') +const toPath = path.resolve(__dirname, '../src/uni_modules/wot-design-uni') +const docPath = path.resolve(__dirname, '../docs/guide') + +try { + const file = fs.readFileSync(fromPath, 'utf-8') + fs.writeFileSync(`${toPath}/changelog.md`, file) + fs.writeFileSync(`${docPath}/changelog.md`, file) +} catch (error) { + console.log('CHANGELOG 获取失败') +} diff --git a/build/release.js b/build/release.js new file mode 100644 index 00000000..79c43215 --- /dev/null +++ b/build/release.js @@ -0,0 +1,80 @@ +/* + * @Author: weisheng + * @Date: 2022-11-01 17:12:57 + * @LastEditTime: 2023-08-02 18:35:01 + * @LastEditors: weisheng + * @Description: 组件发版问答 + * @FilePath: \wot-design-uni\build\release.js + * 记得注释 + */ +const inquirer = require('inquirer') +// Node 核心模块 +const { execSync } = require('child_process') +const { writeFileSync, readFileSync } = require('fs') +const path = require('path') +const src = path.resolve(__dirname, '../src/uni_modules/wot-design-uni') +const oldVersion = require('../package.json').version +inquirer + .prompt([ + { + type: 'list', + name: 'version', + message: '请选择发版类型(默认值:✨ minor)', + choices: ['🐛 patch 小版本', '✨ minor 中版本', '🚀 major 大版本'], + default: '✨ minor 中版本' + }, + { + type: 'list', + name: 'release', + message: '确认发布?', + choices: ['Y', 'N'], + default: 'Y' + } + ]) + .then((answers) => { + if (!answers['release'] || answers['release'].toLowerCase() != 'y') { + console.log('🚨 操作取消') + return + } + // 项目版本更新 + switch (answers['version']) { + case '🐛 patch 小版本': + execSync('yarn release-patch') + break + case '✨ minor 中版本': + execSync('yarn release-minor') + break + case '🚀 major 大版本': + execSync('yarn release-major') + break + default: + execSync('yarn release-minor') + break + } + // 生成日志 + execSync('node build/changelog.js') + // 更新版本 + const file = readFileSync(path.resolve(__dirname, '../package.json')) + const packageJson = JSON.parse(file.toString()) + const version = packageJson.version + console.log(`√ bumping version in package.json from ${oldVersion} to ${version}`) + const package = require('../src/uni_modules/wot-design-uni/package.json') + package.version = version + writeFileSync(path.resolve(src, 'package.json'), JSON.stringify(package)) + execSync('yarn lint') + execSync('git add -A ') + execSync(`git commit -am "build: compile ${version}"`) + execSync(`git tag -a v${version} -am "chore(release): ${version}"`) + console.log('√ committing changes') + const branch = execSync('git branch --show-current').toString().replace(/\*/g, '').replace(/ /g, '') + console.log('🎉 版本发布成功') + const tip = 'Run `git push --follow-tags origin ' + branch + '` ' + 'to publish' + console.log(tip.replace(/\n/g, '')) + }) + .catch((error) => { + if (error.isTtyError) { + // Prompt couldn't be rendered in the current environment + } else { + // Something else went wrong + } + }) diff --git a/commitlint.config.js b/commitlint.config.js index 0367d83f..c023cdf2 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -4,7 +4,7 @@ * @LastEditTime: 2023-03-25 18:12:52 * @LastEditors: weisheng * @Description: - * @FilePath: \fant-mini-plus\commitlint.config.js + * @FilePath: \wot-design-uni\commitlint.config.js * 记得注释 */ module.exports = { diff --git a/package.json b/package.json index 68ddf966..1436e404 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wot-design-uni", - "version": "0.0.1", + "version": "0.0.0", "scripts": { "dev:app": "uni -p app", "dev:app-android": "uni -p app-android", @@ -44,7 +44,7 @@ "release-major": "standard-version --release-as major", "release-minor": "standard-version --release-as minor", "release-patch": "standard-version --release-as patch", - "clean:lib": "rimraf lib", + "release-tag": "node build/release.js", "upload:mp-weixin": "uni build -p mp-weixin && minici --platform weixin", "upload:mp-alipay": "uni build -p mp-alipay && minici --platform alipay", "upload:mp-dingtalk": "uni build -p mp-dingtalk && minici --platform dd" diff --git a/src/env.d.ts b/src/env.d.ts index da88959b..81131e0a 100644 --- a/src/env.d.ts +++ b/src/env.d.ts @@ -4,7 +4,7 @@ * @LastEditTime: 2023-03-21 21:07:02 * @LastEditors: weisheng * @Description: - * @FilePath: \fant-mini-plus\src\env.d.ts + * @FilePath: \wot-design-uni\src\env.d.ts * 记得注释 */ /// diff --git a/src/shime-uni.d.ts b/src/shime-uni.d.ts index 8f2d51bf..4fe1d81d 100644 --- a/src/shime-uni.d.ts +++ b/src/shime-uni.d.ts @@ -5,7 +5,7 @@ * @LastEditTime: 2023-03-21 21:30:30 * @LastEditors: weisheng * @Description: - * @FilePath: \fant-mini-plus\src\shime-uni.d.ts + * @FilePath: \wot-design-uni\src\shime-uni.d.ts * 记得注释 */ export {} diff --git a/src/types.d.ts b/src/types.d.ts deleted file mode 100644 index 934d2395..00000000 --- a/src/types.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* - * @Author: weisheng - * @Date: 2023-03-09 21:36:22 - * @LastEditTime: 2023-03-21 21:32:12 - * @LastEditors: weisheng - * @Description: - * @FilePath: \fant-mini-plus\src\types.d.ts - * 记得注释 - */ -//type.d.ts -declare const ROUTES: [] diff --git a/src/uni_modules/wot-design-uni/package.json b/src/uni_modules/wot-design-uni/package.json index 60485270..d0cfd7f8 100644 --- a/src/uni_modules/wot-design-uni/package.json +++ b/src/uni_modules/wot-design-uni/package.json @@ -1,7 +1,7 @@ { "id": "wot-design-uni", "displayName": "wot-design-uni", - "version": "0.0.1", + "version": "0.0.0", "description": "一个参照Wot-design打造的uni-app组件库,基于Vue3+Typescript开发,提供50+高质量组件,覆盖大量移动端场景", "keywords": [ "wot-design-uni", diff --git a/src/uni_modules/wot-design-uni/readme.md b/src/uni_modules/wot-design-uni/readme.md index ac9e1ecf..ebd50a5d 100644 --- a/src/uni_modules/wot-design-uni/readme.md +++ b/src/uni_modules/wot-design-uni/readme.md @@ -1 +1,54 @@ -# wot-design-uni \ No newline at end of file +

+ logo +

+

Wot Design Uni

+ +

📱 一个参照Wot-design,基于 Vue3 打造的uni-app组件库

+ +

+ + deploy-status + +

+ +

+ 🔥 文档网站 (Netlify) +

+ + +## ✨ 特性 + +- 🚀 支持 APP、H5、微信小程序、支付宝小程序、钉钉小程序 等平台. +- 🚀 50+ 个高质量组件,覆盖移动端主流场景. +- 💪 使用 Typescript 构建,提供良好的组件类型系统. +- 💪 采用 Vue3 最新特性,提升组件性能. +- 📖 提供丰富的文档和组件示例. +- 🎨 支持主题定制,可以定制scss变量以及组件的样式自定义. + +## 📱 预览 + +手机扫描上的二维码访问演示: + + + +

+ + +

+ + +## 安装 + +```bash +yarn add wot-design-uni +``` + +## 快速上手 + +详细说明见 [快速上手](https://wot-design-uni.netlify.app/guide/quickUse.html) + +## LICENSE + +[MIT](https://github.com/Moonofweisheng/wot-design-uni/blob/develop/LICENSE) + + diff --git a/tsconfig.types.json b/tsconfig.types.json deleted file mode 100644 index 13140360..00000000 --- a/tsconfig.types.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - // 继承 tsconfig.json 中的通用配置 - "extends": "./tsconfig.json", - "compilerOptions": { - "removeComments": false, - "skipLibCheck": true, - "declaration": true /* 生成相应的 '.d.ts' file. */, - "declarationDir": "./src/uni_modules/fant-mini-plus/types" /* 类型声明文件输出目录 */, - "emitDeclarationOnly": true /* 只生成声明文件,不生成 js 文件*/, - "rootDir": "./src/uni_modules/fant-mini-plus/" /* 指定输出文件目录(用于输出),用于控制输出目录结构 */, - }, - "include": [ - "src/uni_modules/fant-mini-plus/*.ts",/* 指定编译处理的文件列表 */ - ] -} \ No newline at end of file diff --git a/vite.config.ts b/vite.config.ts index 9681cdaf..7212ef91 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,7 +4,7 @@ * @LastEditTime: 2023-03-29 18:44:48 * @LastEditors: weisheng * @Description: - * @FilePath: \fant-mini-plus\vite.config.ts + * @FilePath: \wot-design-uni\vite.config.ts * 记得注释 */ import { defineConfig } from 'vite'