npm-publish-mcp 0.1.9

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/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 novlan1
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,96 @@
1
+ # NPM 包发布工具
2
+
3
+ `npm-publish-mcp` - NPM 包发布 MCP 工具
4
+
5
+ ## 功能特性
6
+
7
+ - ✅ **触发发布流水线**: 通过 MCP 工具触发 NPM 包发布流水线
8
+ - ✅ **多版本类型支持**: 支持 alpha、beta、patch 三种版本类型
9
+ - ✅ **自动获取 Git 信息**: 自动从当前目录获取仓库地址和分支名称
10
+ - ✅ **外网发布支持**: 支持发布到外网 NPM 仓库
11
+ - ✅ **Monorepo 支持**: 支持指定子包名称进行发布
12
+
13
+ ## 版本类型说明
14
+
15
+ | 类型 | 说明 |
16
+ |------|------|
17
+ | `alpha` | 内测版本,用于内部测试 |
18
+ | `beta` | 公测版本,用于公开测试 |
19
+ | `patch` | 正式补丁版本,用于线上发布 |
20
+
21
+ ## 安装
22
+
23
+ ```bash
24
+ npm install npm-publish-mcp
25
+ # or
26
+ pnpm add npm-publish-mcp
27
+ ```
28
+
29
+ ## MCP 工具调用规则
30
+
31
+ ### NPM 发布工具 (`npm-publish`)
32
+
33
+ **🔴【强制调用规则】**:
34
+
35
+ - 当用户需要发布 NPM 包时,AI 助手必须调用此 MCP 工具
36
+ - 会自动从当前 Git 目录获取仓库地址和分支信息
37
+ - 返回流水线触发结果
38
+
39
+ **参数说明:**
40
+
41
+ | 参数 | 类型 | 必填 | 说明 |
42
+ |------|------|------|------|
43
+ | `versionType` | string | ✅ | 版本类型:alpha、beta、patch |
44
+ | `publishReason` | string | 条件必填 | 发布原因,versionType 为 patch 时必填 |
45
+ | `publishExternalNPM` | boolean | ❌ | 是否发布到外网 NPM,默认 false |
46
+ | `publishPackage` | string | ❌ | 发布的子包名称(Monorepo 场景使用) |
47
+ | `repo` | string | ❌ | Git 仓库地址,不传则自动获取 |
48
+ | `branch` | string | ❌ | Git 分支名称,不传则自动获取 |
49
+
50
+ ## 使用示例
51
+
52
+ ### 发布 alpha 版本
53
+
54
+ ```json
55
+ {
56
+ "versionType": "alpha"
57
+ }
58
+ ```
59
+
60
+ ### 发布 patch 版本到外网
61
+
62
+ ```json
63
+ {
64
+ "versionType": "patch",
65
+ "publishReason": "修复登录页面样式问题",
66
+ "publishExternalNPM": true
67
+ }
68
+ ```
69
+
70
+ > ⚠️ **注意**:发布 patch 正式版本时,必须填写 `publishReason` 说明发布原因
71
+
72
+ ### 发布 Monorepo 中的指定子包
73
+
74
+ ```json
75
+ {
76
+ "versionType": "beta",
77
+ "publishPackage": "my-package"
78
+ }
79
+ ```
80
+
81
+ ## 环境变量
82
+
83
+ | 变量名 | 说明 |
84
+ |--------|------|
85
+ | `NPM_PUBLISH_API_URL` | 发布接口地址 |
86
+
87
+ ## 开发
88
+
89
+ ```bash
90
+ # 构建
91
+ pnpm --filter "npm-publish-mcp" build
92
+ ```
93
+
94
+ ## 许可证
95
+
96
+ MIT