diff --git a/README.md b/README.md index 6ee1e3c..087c58b 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,7 @@ 1. 安装 UI 库 ```shell -<<<<<<< HEAD npm install litos-ui-vue -======= -npm install @asteres/litos-ui-vue ->>>>>>> 45a3da1c (chore: v0.0.1) ``` 2. 安装自动导入插件 @@ -29,11 +25,7 @@ import { defineConfig } from 'vite'; import vue from '@vitejs/plugin-vue'; import AutoImport from 'unplugin-auto-import/vite'; import Components from 'unplugin-vue-components/vite'; -<<<<<<< HEAD import LitosUiResolver from 'litos-ui-vue-resolver'; -======= -import NeatuiResolver from 'litos-ui-vue-resolver'; ->>>>>>> 45a3da1c (chore: v0.0.1) // https://vitejs.dev/config/ export default defineConfig({ @@ -56,20 +48,12 @@ export default defineConfig({ 在 `main.ts` 中引入全局 CSS 变量文件 ```js -<<<<<<< HEAD import 'litos-ui-vue/style/vars.css'; -======= -import '@asteres/litos-ui-vue/style/vars.css'; ->>>>>>> 45a3da1c (chore: v0.0.1) ``` ## 文档 -<<<<<<< HEAD [中文文档](https://dvshu.github.io/litos-ui-vue/) -======= -[中文 文档](https://dvshu.github.io/litos-ui-vue/) ->>>>>>> 45a3da1c (chore: v0.0.1) ## [更新记录](https://github.com/DvShu/litos-ui-vue/blob/main/CHANGELOG.md) diff --git a/scripts/publish.js b/scripts/publish.js index e69de29..6d3010f 100644 --- a/scripts/publish.js +++ b/scripts/publish.js @@ -0,0 +1,59 @@ +import { spawn } from 'node:child_process'; + +/* + 步骤: + 1. 切换到主分支: gi t checkout main + 2. rebase dev -> main: git rebase dev + 3. 获取提交信息: git log --format="%H--%s" -n 10 + 4. 修改 changelog、package.json 版本号 + 5. 提交: git commit -m "chore: release v1.0.0" + 6. 上传: git push origin main + 7. 构建: pnpm lib:build + 8. 发布: npm publish --registry https://registry.npmjs.org/ + 9. 切换回 dev分支: git checkout dev +*/ + +// 启动一个持久化的 shell 进程 +const shell = spawn('powershell.exe', { + shell: true, + windowsHide: true, +}); + +let step = 0; + +const commitHistory = [] + +// 监听输出 +shell.stdout.on('data', (data) => { + if (step === 2) { + // 获取提交信息成功 + commitHistory.push(data); + } + step++; +}); + +shell.stdout.on('end', () => { + switch (step) { + case 0: + // 切换到主分支// 切换到主分支成功后, 使用 rebase 合并 dev -> main + shell.stdin.write('git rebase dev\n'); + break; + case 1: + // 合并 dev -> main 成功后, 获取历史提交信息 + shell.stdin.write('git log --format="%H--%s" -n 10\n'); + break; + case 2: + // 获取提交信息成功 + console.log(commitHistory); + break; + } +}) + +shell.stderr.on('data', (data) => { + console.error(`stderr: ${data}`); + shell.stdin.end(); +}); + +// 1. 切换到主分支 +shell.stdin.write('git checkout main\n'); +step++;