Skip to content

Commit

Permalink
docs: 修复文档
Browse files Browse the repository at this point in the history
  • Loading branch information
Tenny committed Nov 25, 2024
1 parent b05934c commit d16d534
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 16 deletions.
16 changes: 0 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. 安装自动导入插件
Expand All @@ -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({
Expand All @@ -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)

Expand Down
59 changes: 59 additions & 0 deletions scripts/publish.js
Original file line number Diff line number Diff line change
@@ -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++;

0 comments on commit d16d534

Please sign in to comment.