Commit 90b3136e by chunhong.mu

feat(test-demo-web): add test project and update branch naming

parent ad1d9ba5
......@@ -431,8 +431,8 @@ staging ← 预发环境,测试通过后合并
dev ← 总开发分支(release 环境)
dev/official-site-web ← 官网项目开发分支
dev/admin-web ← 管理后台开发分支
feature/official-site-web ← 官网项目开发分支
feature/admin-web ← 管理后台开发分支
hotfix ← 紧急修复分支(唯一)
refactor ← 重构分支(唯一)
```
......@@ -443,8 +443,8 @@ refactor ← 重构分支(唯一)
|------|------|---------|---------|
| `release` | 生产代码,只接受来自 `staging` 的合并 | 禁止直接提交,需 PR | production |
| `staging` | 预发验证,只接受来自 `dev` 的合并 | 禁止直接提交 | staging |
| `dev` | 总开发分支,所有项目合并入口 | 允许合并 dev/项目名 | release |
| `dev/项目名` | 项目开发分支,日常开发 | 允许直接提交 | - |
| `dev` | 总开发分支,所有项目合并入口 | 允许合并 feature/项目名 | release |
| `feature/项目名` | 项目开发分支,日常开发 | 允许直接提交 | - |
| `hotfix` | 紧急修复(唯一分支,所有 hotfix 在此开发) | 无 | - |
| `refactor` | 重构(唯一分支,所有重构在此开发) | 无 | - |
......@@ -452,7 +452,7 @@ refactor ← 重构分支(唯一)
| 类型 | 命名格式 | 示例 |
|------|---------|------|
| 项目开发分支 | `dev/项目名` | `dev/official-site-web``dev/admin-web` |
| 项目开发分支 | `feature/项目名` | `feature/official-site-web``feature/admin-web` |
| 紧急修复 | `hotfix`(固定名称) | 所有紧急修复都在此分支 |
| 重构 | `refactor`(固定名称) | 所有重构都在此分支 |
......@@ -492,7 +492,7 @@ pnpm git:refactor-done
```bash
pnpm git:dev-start official-site-web
# 日常开发直接在 dev/official-site-web 提交
# 日常开发直接在 feature/official-site-web 提交
# 小 bug 也直接在此分支修复
pnpm git:dev-done official-site-web # 合并回 dev
......
export default {
extends: ['@commitlint/config-conventional'],
rules: {
'scope-enum': [2, 'always', ["root", "*", "@common/utils", "@common/vue-kit", "official-site-web"]],
'scope-empty': [2, 'never'],
},
'scope-enum': [2, 'always', ["root","*","@common/utils","@common/vue-kit","official-site-web","test-demo-web"]],
'scope-empty': [2, 'never']
}
}
APP_ENV=dev
NODE_ENV=development
APP_ENV=production
NODE_ENV=production
APP_ENV=staging
NODE_ENV=production
APP_ENV=test
NODE_ENV=production
<template>
<div>
<NuxtPage />
</div>
</template>
export default defineNuxtConfig({
devtools: { enabled: true },
modules: ['@unocss/nuxt'],
})
{
"name": "test-demo-web",
"type": "module",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "nuxt dev",
"build": "nuxt build",
"generate": "nuxt generate",
"preview": "nuxt preview"
},
"dependencies": {
"nuxt": "^3.14.1",
"vue": "^3.4.0",
"ant-design-vue": "^4.2.6",
"axios": "^1.7.9",
"pinia": "^2.1.7"
},
"devDependencies": {
"typescript": "^5.6.3",
"unocss": "^0.58.0"
}
}
<template>
<div>
<h1>test-demo-web</h1>
</div>
</template>
<script setup lang="ts">
//
</script>
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"jsx": "preserve",
"resolveJsonModule": true,
"isolatedModules": true,
"esModuleInterop": true,
"lib": [
"ESNext",
"DOM"
],
"skipLibCheck": true,
"paths": {
"@/*": [
"./*"
]
}
},
"include": [
"**/*.ts",
"**/*.vue"
],
"exclude": [
"node_modules",
"dist"
]
}
......@@ -56,7 +56,7 @@ const commands = {
console.error('Example: pnpm git:dev-start official-site-web')
process.exit(1)
}
const branchName = `dev/${projectName}`
const branchName = `feature/${projectName}`
checkCleanWorkingTree()
if (branchExists(branchName))
......@@ -89,7 +89,7 @@ const commands = {
console.error('Example: pnpm git:dev-done official-site-web')
process.exit(1)
}
const branchName = `dev/${projectName}`
const branchName = `feature/${projectName}`
checkCleanWorkingTree()
console.log(`Merging ${branchName} into dev...`)
......
......@@ -230,12 +230,12 @@ console.log('Commitlint scope whitelist updated automatically')
/**
* 步骤 9:创建并切换到项目开发分支
* 从 dev 分支创建 dev/项目名 分支
* 从 dev 分支创建 feature/<project> 分支(避免与 dev 分支命名冲突)
*/
console.log('Creating dev branch...')
execSync('git checkout dev', { stdio: 'inherit' })
execSync(`git checkout -b dev/${projectName}`, { stdio: 'inherit' })
console.log(`Switched to dev/${projectName}`)
execSync(`git checkout -b feature/${projectName}`, { stdio: 'inherit' })
console.log(`Switched to feature/${projectName}`)
console.log(`\nProject "${projectName}" created successfully!`)
console.log(`\nNext steps:`)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment