create-dwy 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/sync.js
CHANGED
|
@@ -28,6 +28,14 @@ export async function syncClaude() {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
// Sync CLAUDE.md
|
|
32
|
+
const claudeMdSrc = path.join(sourceDir, 'CLAUDE.md')
|
|
33
|
+
if (await fs.pathExists(claudeMdSrc)) {
|
|
34
|
+
await fs.copy(claudeMdSrc, path.join(targetDir, 'CLAUDE.md'))
|
|
35
|
+
syncedCount++
|
|
36
|
+
console.log(chalk.green(' ✓ CLAUDE.md'))
|
|
37
|
+
}
|
|
38
|
+
|
|
31
39
|
const settingsSrc = path.join(sourceDir, 'settings.json')
|
|
32
40
|
if (await fs.pathExists(settingsSrc)) {
|
|
33
41
|
const settingsDest = path.join(targetDir, 'settings.json')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
所有回答必须使用中文。
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# 优先使用成熟开源方案
|
|
2
|
+
|
|
3
|
+
开发新功能时,优先选用成熟的开源项目/库,而不是手写实现。只有在确认没有合适的开源方案时,才自行实现。
|
|
4
|
+
|
|
5
|
+
## 决策流程
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
需要某项功能
|
|
9
|
+
→ 1. 搜索是否有成熟的开源库(npm/PyPI/GitHub stars > 1k、近期有维护)
|
|
10
|
+
→ 有:评估是否适配当前技术栈(Vue 3 / FastAPI / Node.js)
|
|
11
|
+
→ 适配:直接使用,不重复造轮子
|
|
12
|
+
→ 不适配:寻找替代方案
|
|
13
|
+
→ 没有合适的:自行实现,但在代码注释中说明为什么没用现成方案
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## 强制规则
|
|
17
|
+
|
|
18
|
+
- **禁止**手写已有成熟方案的功能:日期处理(dayjs/date-fns)、HTTP 请求(axios)、表单校验(zod/vee-validate)、状态管理(pinia)、图表(echarts/chart.js)、富文本(tiptap/quill)、拖拽(vuedraggable/dnd-kit)、虚拟滚动(@tanstack/virtual)、Markdown 渲染(markdown-it)、模糊搜索(fuse.js)
|
|
19
|
+
- **禁止**手写加密/哈希/JWT 算法,必须使用 bcrypt/jose/crypto 等标准库
|
|
20
|
+
- 选用开源库时,优先选择:项目已在用的依赖 > 社区主流方案 > 小众但适合的方案
|
|
21
|
+
|
|
22
|
+
## 例外情况
|
|
23
|
+
|
|
24
|
+
以下情况允许自行实现:
|
|
25
|
+
- 功能极其简单(< 20 行),引入一个库反而增加复杂度
|
|
26
|
+
- 开源库有严重的安全漏洞或已停止维护
|
|
27
|
+
- 开源库的依赖体积过大,与需求不成比例
|
|
28
|
+
- 项目有特殊定制需求,开源库无法满足且改造成本高于自建
|