mirror of
https://gitee.com/wot-design-uni/wot-design-uni.git
synced 2025-12-06 17:18:40 +08:00
chore: 🚀 构建命令调整
This commit is contained in:
parent
20d5e949d8
commit
aeadb4debf
@ -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 = {
|
||||
|
||||
22
build/changelog.js
Normal file
22
build/changelog.js
Normal 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
80
build/release.js
Normal file
@ -0,0 +1,80 @@
|
||||
/*
|
||||
* @Author: weisheng
|
||||
* @Date: 2022-11-01 17:12:57
|
||||
* @LastEditTime: 2023-08-02 17:59:15
|
||||
* @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 ./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
|
||||
}
|
||||
})
|
||||
@ -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 = {
|
||||
|
||||
@ -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"
|
||||
|
||||
2
src/env.d.ts
vendored
2
src/env.d.ts
vendored
@ -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
|
||||
* 记得注释
|
||||
*/
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
2
src/shime-uni.d.ts
vendored
2
src/shime-uni.d.ts
vendored
@ -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 {}
|
||||
|
||||
11
src/types.d.ts
vendored
11
src/types.d.ts
vendored
@ -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: []
|
||||
@ -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",
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
|
||||
@ -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",/* 指定编译处理的文件列表 */
|
||||
]
|
||||
}
|
||||
@ -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'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user