create-codeforge-app 1.0.4 → 1.0.5
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/README.md +38 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -77,3 +77,41 @@ cd client && npm run dev # 前端 http://localhost:5173
|
|
|
77
77
|
- `TUTORIAL.md` — 新增业务模块的完整教程(5 步流程)
|
|
78
78
|
- `DEVELOP.md` — 本地开发环境搭建 + 代码规范
|
|
79
79
|
- `DEPLOY.md` — 部署指南(服务器 / Railway / Cloudflare Pages)
|
|
80
|
+
|
|
81
|
+
## 维护者指南(发布新版本)
|
|
82
|
+
|
|
83
|
+
以下内容仅针对维护者(你自己),普通用户使用 `npx` 不需要任何 token。
|
|
84
|
+
|
|
85
|
+
### npm Token 说明
|
|
86
|
+
|
|
87
|
+
| 场景 | 需要 token 吗 |
|
|
88
|
+
|------|-------------|
|
|
89
|
+
| `npx create-codeforge-app my-shop` 使用 | ❌ 不需要,任何人都能用 |
|
|
90
|
+
| 修改 CLI 代码后 `npm publish` 发布新版本 | ✅ 需要 |
|
|
91
|
+
|
|
92
|
+
Token 有效期 90 天,过期后只影响发布,不影响使用。
|
|
93
|
+
|
|
94
|
+
### Token 过期后如何操作
|
|
95
|
+
|
|
96
|
+
1. 打开 https://www.npmjs.com/settings/codeforge-arch/tokens
|
|
97
|
+
2. 点 **"Generate New Token"**
|
|
98
|
+
3. **Token name**: 随便填,如 `publish-2024`
|
|
99
|
+
4. **勾选** Bypass two-factor authentication (2FA)
|
|
100
|
+
5. **Permissions**: 选 **Read and write**
|
|
101
|
+
6. **Select packages**: 选 **All packages**
|
|
102
|
+
7. 点生成,复制新 token
|
|
103
|
+
8. 终端执行:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
echo "//registry.npmjs.org/:_authToken=你的新token" > ~/.npmrc
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
9. 然后就可以发布了:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
cd create-codeforge
|
|
113
|
+
npm version patch # 自动升版本号
|
|
114
|
+
npm publish # 发布
|
|
115
|
+
git push # 推送到 GitHub
|
|
116
|
+
```
|
|
117
|
+
|