nsbp-cli 0.2.4 → 0.2.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 +7 -11
- package/package.json +1 -1
- package/templates/basic/Makefile +2 -21
- package/templates/basic/README.md +11 -1
package/README.md
CHANGED
|
@@ -28,8 +28,8 @@ Create a new NSBP project with a single command:
|
|
|
28
28
|
```bash
|
|
29
29
|
nsbp create my-app
|
|
30
30
|
cd my-app
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
pnpm install # NSBP CLI uses pnpm as package manager
|
|
32
|
+
pnpm run dev
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
For development with Docker (recommended):
|
|
@@ -110,7 +110,8 @@ Location: `cli/scripts/sync-template.js`
|
|
|
110
110
|
### Usage
|
|
111
111
|
```bash
|
|
112
112
|
cd cli
|
|
113
|
-
|
|
113
|
+
pnpm run update # CLI项目使用pnpm,运行同步脚本
|
|
114
|
+
# 或者使用 npm run update(兼容)
|
|
114
115
|
```
|
|
115
116
|
|
|
116
117
|
### Features
|
|
@@ -136,22 +137,17 @@ To work on the CLI locally:
|
|
|
136
137
|
|
|
137
138
|
```bash
|
|
138
139
|
cd cli
|
|
139
|
-
|
|
140
|
+
pnpm install # CLI项目使用pnpm作为包管理器
|
|
140
141
|
node ./bin/nsbp.js --help # Test CLI locally
|
|
141
142
|
```
|
|
142
143
|
|
|
143
|
-
### Publishing Updates
|
|
144
|
-
From the NSBP project root:
|
|
145
|
-
```bash
|
|
146
|
-
make publish-cli # Syncs templates, updates version, publishes to npm
|
|
147
|
-
```
|
|
148
|
-
|
|
149
144
|
## Package Information
|
|
150
145
|
|
|
151
146
|
- **Package Name**: `nsbp-cli`
|
|
152
147
|
- **Bin Command**: `nsbp` (install globally and run `nsbp --help`)
|
|
153
|
-
- **Version**: `0.2.
|
|
148
|
+
- **Version**: `0.2.4`
|
|
154
149
|
- **Dependencies**: chalk, commander, fs-extra, inquirer
|
|
150
|
+
- **Package Manager**: Uses pnpm (also compatible with npm)
|
|
155
151
|
- **Node Version**: >=16.0.0
|
|
156
152
|
|
|
157
153
|
## License
|
package/package.json
CHANGED
package/templates/basic/Makefile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.PHONY: help build dev prod down clean logs restart
|
|
1
|
+
.PHONY: help build dev prod down clean logs restart
|
|
2
2
|
|
|
3
3
|
help: ## Show this help message
|
|
4
4
|
@echo 'Usage: make [target]'
|
|
@@ -51,23 +51,4 @@ shell-dev: ## Open shell in development container
|
|
|
51
51
|
docker-compose -f docker-compose.dev.yml exec app sh
|
|
52
52
|
|
|
53
53
|
test: ## Run tests (if configured)
|
|
54
|
-
docker-compose exec app npm test
|
|
55
|
-
|
|
56
|
-
publish-cli: ## Publish CLI to npm registry
|
|
57
|
-
@echo "🚀 Starting CLI publish process..."
|
|
58
|
-
cd cli && npm run update
|
|
59
|
-
@echo "📦 Template updated, committing changes..."
|
|
60
|
-
git add .
|
|
61
|
-
git diff --quiet && git diff --cached --quiet || git commit -m "chore: update cli template"
|
|
62
|
-
@echo "🔖 Updating version..."
|
|
63
|
-
cd cli && npm version patch --no-git-tag-version
|
|
64
|
-
@echo "📝 Committing version bump..."
|
|
65
|
-
git add cli/package.json
|
|
66
|
-
git commit -m "chore: bump version to v$$(cd cli && node -p "require('./package.json').version")"
|
|
67
|
-
@echo "🏷️ Creating git tag..."
|
|
68
|
-
git tag -a "v$$(cd cli && node -p "require('./package.json').version")" -m "Version $$(cd cli && node -p "require('./package.json').version")"
|
|
69
|
-
@echo "📤 Publishing to npm..."
|
|
70
|
-
cd cli && npm publish
|
|
71
|
-
@echo "📤 Pushing to git repository..."
|
|
72
|
-
git push --follow-tags
|
|
73
|
-
@echo "✅ CLI published successfully!"
|
|
54
|
+
docker-compose exec app npm test
|
|
@@ -134,4 +134,14 @@ make rebuild-dev # 重新构建并启动开发环境
|
|
|
134
134
|
可在 `docker-compose.yml` 或 `docker-compose.dev.yml` 中配置环境变量:
|
|
135
135
|
|
|
136
136
|
- `NODE_ENV`: 运行环境 (production/development)
|
|
137
|
-
- `PORT`: 服务端口 (默认 3001)
|
|
137
|
+
- `PORT`: 服务端口 (默认 3001)
|
|
138
|
+
|
|
139
|
+
### CLI 发布
|
|
140
|
+
|
|
141
|
+
从项目根目录发布 CLI 到 npm 注册表:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
make publish-cli # 同步模板、更新版本、发布到 npm
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
注意:此命令仅在项目根目录可用,生成的 NSBP 项目不包含此目标。
|