chore: 🚀 调整构建命令

This commit is contained in:
xuqingkai 2023-08-02 18:39:26 +08:00
parent 20d5e949d8
commit de13c95fbb
14 changed files with 228 additions and 51 deletions

View File

@ -4,7 +4,7 @@
* @LastEditTime: 2023-03-28 16:52:32 * @LastEditTime: 2023-03-28 16:52:32
* @LastEditors: weisheng * @LastEditors: weisheng
* @Description: * @Description:
* @FilePath: \fant-mini-plus\.eslintrc.js * @FilePath: \wot-design-uni\.eslintrc.js
* 记得注释 * 记得注释
*/ */
module.exports = { module.exports = {

64
.versionrc Normal file
View File

@ -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
}
]
}

View File

@ -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"
}
}

22
build/changelog.js Normal file
View File

@ -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 获取失败')
}

80
build/release.js Normal file
View File

@ -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
}
})

View File

@ -4,7 +4,7 @@
* @LastEditTime: 2023-03-25 18:12:52 * @LastEditTime: 2023-03-25 18:12:52
* @LastEditors: weisheng * @LastEditors: weisheng
* @Description: * @Description:
* @FilePath: \fant-mini-plus\commitlint.config.js * @FilePath: \wot-design-uni\commitlint.config.js
* 记得注释 * 记得注释
*/ */
module.exports = { module.exports = {

View File

@ -1,6 +1,6 @@
{ {
"name": "wot-design-uni", "name": "wot-design-uni",
"version": "0.0.1", "version": "0.0.0",
"scripts": { "scripts": {
"dev:app": "uni -p app", "dev:app": "uni -p app",
"dev:app-android": "uni -p app-android", "dev:app-android": "uni -p app-android",
@ -44,7 +44,7 @@
"release-major": "standard-version --release-as major", "release-major": "standard-version --release-as major",
"release-minor": "standard-version --release-as minor", "release-minor": "standard-version --release-as minor",
"release-patch": "standard-version --release-as patch", "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-weixin": "uni build -p mp-weixin && minici --platform weixin",
"upload:mp-alipay": "uni build -p mp-alipay && minici --platform alipay", "upload:mp-alipay": "uni build -p mp-alipay && minici --platform alipay",
"upload:mp-dingtalk": "uni build -p mp-dingtalk && minici --platform dd" "upload:mp-dingtalk": "uni build -p mp-dingtalk && minici --platform dd"

2
src/env.d.ts vendored
View File

@ -4,7 +4,7 @@
* @LastEditTime: 2023-03-21 21:07:02 * @LastEditTime: 2023-03-21 21:07:02
* @LastEditors: weisheng * @LastEditors: weisheng
* @Description: * @Description:
* @FilePath: \fant-mini-plus\src\env.d.ts * @FilePath: \wot-design-uni\src\env.d.ts
* *
*/ */
/// <reference types="vite/client" /> /// <reference types="vite/client" />

2
src/shime-uni.d.ts vendored
View File

@ -5,7 +5,7 @@
* @LastEditTime: 2023-03-21 21:30:30 * @LastEditTime: 2023-03-21 21:30:30
* @LastEditors: weisheng * @LastEditors: weisheng
* @Description: * @Description:
* @FilePath: \fant-mini-plus\src\shime-uni.d.ts * @FilePath: \wot-design-uni\src\shime-uni.d.ts
* *
*/ */
export {} export {}

11
src/types.d.ts vendored
View File

@ -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: []

View File

@ -1,7 +1,7 @@
{ {
"id": "wot-design-uni", "id": "wot-design-uni",
"displayName": "wot-design-uni", "displayName": "wot-design-uni",
"version": "0.0.1", "version": "0.0.0",
"description": "一个参照Wot-design打造的uni-app组件库基于Vue3+Typescript开发提供50+高质量组件,覆盖大量移动端场景", "description": "一个参照Wot-design打造的uni-app组件库基于Vue3+Typescript开发提供50+高质量组件,覆盖大量移动端场景",
"keywords": [ "keywords": [
"wot-design-uni", "wot-design-uni",

View File

@ -1 +1,54 @@
# wot-design-uni <p align="center">
<img alt="logo" src="https://wot-design-uni.netlify.app/wot-design.png" width="200">
</p>
<h1 align="center">Wot Design Uni</h1>
<p align="center">📱 一个参照<a href="https://ftf.jd.com/wot-design/">Wot-design</a>,基于 Vue3 打造的uni-app组件库</p>
<p align="center">
<a href="https://app.netlify.com/sites/wot-design-uni/deploys" target="_blank" referrerpolicy="no-referrer">
<img src="https://api.netlify.com/api/v1/badges/0991d8a9-0fb0-483b-8961-5bde066bbd50/deploy-status" alt="deploy-status" />
</a>
</p>
<p align="center">
🔥 <a href="https://wot-design-uni.netlify.app/">文档网站 (Netlify)</a>
</p>
## ✨ 特性
- 🚀 支持 APP、H5、微信小程序、支付宝小程序、钉钉小程序 等平台.
- 🚀 50+ 个高质量组件,覆盖移动端主流场景.
- 💪 使用 Typescript 构建,提供良好的组件类型系统.
- 💪 采用 Vue3 最新特性,提升组件性能.
- 📖 提供丰富的文档和组件示例.
- 🎨 支持主题定制可以定制scss变量以及组件的样式自定义.
## 📱 预览
手机扫描上的二维码访问演示:
<p>
<img src="https://wot-design-uni.netlify.app/wx.jpg" width="200" height="200" style="margin-right:30px"/>
<img src="https://wot-design-uni.netlify.app/alipay.png" width="200" height="200" />
</p>
## 安装
```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)

View File

@ -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",/* */
]
}

View File

@ -4,7 +4,7 @@
* @LastEditTime: 2023-03-29 18:44:48 * @LastEditTime: 2023-03-29 18:44:48
* @LastEditors: weisheng * @LastEditors: weisheng
* @Description: * @Description:
* @FilePath: \fant-mini-plus\vite.config.ts * @FilePath: \wot-design-uni\vite.config.ts
* *
*/ */
import { defineConfig } from 'vite' import { defineConfig } from 'vite'