@vill-v/bumpp-gitcode 4.2.0

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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 白鸢
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # @vill-v/bumpp-gitcode
2
+
3
+ 遵循 semver 规范进行 release 的工具包(暂时只针对个人使用,并没有开放过多的配置项)
4
+
5
+ 为 [@vill-v/bumpp](https://npmx.dev/package/@vill-v/bumpp) 的拓展模块
6
+
7
+ 可以在 release 后在 gitcode 上 添加发型说明
8
+
9
+ ## 设置 gitcode access_token
10
+
11
+ 在node项目下,或者用户目录下 创建 `.vbumpprc` 文件
12
+
13
+ 配置文件示例
14
+
15
+ ```npmrc
16
+ accesstoken.gitcode=tokenxxxxx
17
+ ```
18
+
19
+ ## 简单使用
20
+
21
+ ```shell
22
+ vbumpp
23
+ ```
24
+
25
+ ## monorepo项目
26
+
27
+ ```shell
28
+ vbumpp -r
29
+ ```
30
+
31
+ ## 自定义bump文件
32
+
33
+ ```shell
34
+ vbumpp package.json packages/*/package.json
35
+ ```
36
+
37
+ ## ❤️ 鸣谢
38
+
39
+ [bumpp](https://github.com/antfu/bumpp)
40
+
41
+ [changelogen](https://github.com/unjs/changelogen)
42
+
43
+ ## License
44
+
45
+ [MIT](https://gitee.com/vill-v/bump/blob/main/LICENSE)
package/bin/index.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { createCli } from '../dist/cli.js'
4
+
5
+ createCli()
@@ -0,0 +1,22 @@
1
+ import { bumpVersionWithBaseRelease } from "@vill-v/bumpp";
2
+ import { createGithubLikeRelease } from "@vill-v/bumpp-github";
3
+ import consola from "consola";
4
+ //#region src/bump.ts
5
+ const createGitcodeRelease = async (options) => {
6
+ const access_token = options.config.accesstoken?.gitcode;
7
+ await (await createGithubLikeRelease({
8
+ baseURL: "https://api.gitcode.com/api/v5",
9
+ onRequest(context) {
10
+ context.options.query = {
11
+ ...context.options.query,
12
+ access_token
13
+ };
14
+ },
15
+ async onResponseError({ response }) {
16
+ consola.error("gitcode [open api] error :", response._data?.message || "");
17
+ }
18
+ }))(options);
19
+ };
20
+ const bumpVersion = async (option = {}) => bumpVersionWithBaseRelease(option, createGitcodeRelease, "GitCode");
21
+ //#endregion
22
+ export { bumpVersion as t };
package/dist/cli.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ //#region src/cli.d.ts
2
+ declare const createCli: () => void;
3
+ //#endregion
4
+ export { createCli };
package/dist/cli.js ADDED
@@ -0,0 +1,6 @@
1
+ import { t as bumpVersion } from "./bump-BcYw_BGc.js";
2
+ import { createBaseCli } from "@vill-v/bumpp/cli";
3
+ //#region src/cli.ts
4
+ const createCli = () => createBaseCli(bumpVersion);
5
+ //#endregion
6
+ export { createCli };
@@ -0,0 +1,12 @@
1
+ import { Config, defineConfig } from "@vill-v/bumpp";
2
+ //#region src/bump.d.ts
3
+ declare const bumpVersion: (option?: Config) => Promise<void>;
4
+ //#endregion
5
+ //#region src/index.d.ts
6
+ declare module '@vill-v/bumpp' {
7
+ interface Accesstokens {
8
+ gitcode: string;
9
+ }
10
+ }
11
+ //#endregion
12
+ export { bumpVersion, defineConfig };
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ import { t as bumpVersion } from "./bump-BcYw_BGc.js";
2
+ import { defineConfig } from "@vill-v/bumpp";
3
+ export { bumpVersion, defineConfig };
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@vill-v/bumpp-gitcode",
3
+ "version": "4.2.0",
4
+ "license": "MIT",
5
+ "author": {
6
+ "name": "whitekite",
7
+ "email": "1075790909@qq.com"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://gitee.com/vill-v/bump",
12
+ "directory": "packages/gitcode"
13
+ },
14
+ "bin": {
15
+ "vbumpp": "bin/index.js"
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "bin"
20
+ ],
21
+ "type": "module",
22
+ "types": "./dist/index.d.ts",
23
+ "exports": {
24
+ ".": "./dist/index.js",
25
+ "./cli": "./dist/cli.js",
26
+ "./package.json": "./package.json"
27
+ },
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
31
+ "dependencies": {
32
+ "consola": "^3.4.2",
33
+ "@vill-v/bumpp": "4.2.0",
34
+ "@vill-v/bumpp-github": "4.2.0"
35
+ },
36
+ "engines": {
37
+ "node": "^20.19.0 || >=22.12.0"
38
+ },
39
+ "scripts": {
40
+ "build": "tsdown"
41
+ }
42
+ }