release-it-gitea 1.8.0 → 1.9.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/lib/global.d.d.ts CHANGED
@@ -3,6 +3,11 @@ declare module "release-it" {
3
3
  getContext(): Context;
4
4
  getContext(path: string): unknown;
5
5
  isDryRun: boolean;
6
+ options: {
7
+ plugins: {
8
+ "release-it-gitea"?: GiteaConfig;
9
+ };
10
+ };
6
11
  setContext(path: string, value: unknown): void;
7
12
  }
8
13
 
@@ -104,4 +109,7 @@ interface GiteaConfig {
104
109
 
105
110
  /** 要上传的附件列表 */
106
111
  assets?: (GiteaAssetConfig | string)[];
112
+
113
+ /** 是否从 config.options.plugins["release-it-gitea"] 动态读取 配置 */
114
+ readOptionsKeys?: (keyof GiteaConfig)[];
107
115
  }
package/lib/index.js CHANGED
@@ -32,6 +32,24 @@ class GiteaPlugin extends Plugin {
32
32
  timeout: gitea.timeout ?? 3e4,
33
33
  tokenRef: gitea.tokenRef ?? "GITEA_TOKEN"
34
34
  };
35
+ if (gitea.readOptionsKeys?.length) {
36
+ const dynReleaseItGiteaConfig = this.config.getContext(
37
+ "release-it-gitea"
38
+ );
39
+ if (dynReleaseItGiteaConfig) {
40
+ for (const option of gitea.readOptionsKeys) {
41
+ if (option in dynReleaseItGiteaConfig) {
42
+ if (Array.isArray(dynReleaseItGiteaConfig[option])) {
43
+ config[option] = dynReleaseItGiteaConfig[option].concat(
44
+ config[option] ?? []
45
+ );
46
+ } else {
47
+ config[option] = dynReleaseItGiteaConfig[option];
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
35
53
  if (!config.host) {
36
54
  throw new Error("Gitea host \u914D\u7F6E\u662F\u5FC5\u9700\u7684");
37
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-it-gitea",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "release-it gitea plugin.",
5
5
  "keywords": [
6
6
  "gitea",
@@ -48,42 +48,42 @@
48
48
  "node-fetch": "^3.3.2"
49
49
  },
50
50
  "devDependencies": {
51
- "@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
52
- "@eslint/js": "9.22.0",
51
+ "@eslint-community/eslint-plugin-eslint-comments": "4.7.0",
52
+ "@eslint/js": "9.39.2",
53
53
  "@release-it/conventional-changelog": "10.0.0",
54
- "@types/archiver": "^7.0.0",
55
- "@types/node": "22.13.10",
54
+ "@types/archiver": "7.0.0",
55
+ "@types/node": "24.12.0",
56
56
  "@vitest/coverage-v8": "4.0.16",
57
- "@vitest/eslint-plugin": "1.1.38",
57
+ "@vitest/eslint-plugin": "1.6.4",
58
58
  "console-fail-test": "0.6.1",
59
- "cspell": "9.4.0",
60
- "eslint": "9.22.0",
61
- "eslint-plugin-jsdoc": "61.5.0",
62
- "eslint-plugin-jsonc": "2.20.0",
63
- "eslint-plugin-n": "17.16.2",
64
- "eslint-plugin-package-json": "0.87.1",
65
- "eslint-plugin-perfectionist": "5.2.0",
66
- "eslint-plugin-regexp": "2.10.0",
67
- "eslint-plugin-yml": "1.19.1",
59
+ "cspell": "9.7.0",
60
+ "eslint": "9.39.2",
61
+ "eslint-plugin-jsdoc": "62.7.0",
62
+ "eslint-plugin-jsonc": "3.1.0",
63
+ "eslint-plugin-n": "17.24.0",
64
+ "eslint-plugin-package-json": "0.88.0",
65
+ "eslint-plugin-perfectionist": "5.6.0",
66
+ "eslint-plugin-regexp": "3.0.0",
67
+ "eslint-plugin-yml": "3.3.0",
68
68
  "husky": "9.1.7",
69
- "knip": "5.79.0",
70
- "lint-staged": "16.2.7",
69
+ "knip": "5.86.0",
70
+ "lint-staged": "16.3.0",
71
71
  "markdownlint": "0.40.0",
72
- "markdownlint-cli": "0.47.0",
73
- "prettier": "3.7.4",
72
+ "markdownlint-cli": "0.48.0",
73
+ "prettier": "3.8.0",
74
74
  "prettier-plugin-curly": "0.4.1",
75
- "prettier-plugin-packagejson": "2.5.10",
75
+ "prettier-plugin-packagejson": "3.0.0",
76
76
  "prettier-plugin-sh": "0.18.0",
77
77
  "release-it": "19.2.2",
78
78
  "tsup": "8.5.1",
79
79
  "typescript": "5.9.3",
80
- "typescript-eslint": "8.51.0",
80
+ "typescript-eslint": "8.56.0",
81
81
  "vitest": "4.0.16"
82
82
  },
83
83
  "peerDependencies": {
84
84
  "release-it": "^19.0.3"
85
85
  },
86
- "packageManager": "pnpm@10.4.0",
86
+ "packageManager": "pnpm@10.31.0",
87
87
  "engines": {
88
88
  "node": ">=18.3.0"
89
89
  },
@@ -93,8 +93,8 @@
93
93
  "pnpm": {
94
94
  "overrides": {
95
95
  "form-data": "^4.0.5",
96
- "glob": "^11.1.0",
97
- "vite": "^6.4.0"
96
+ "glob": "^13.0.0",
97
+ "vite": "^7.0.0"
98
98
  }
99
99
  }
100
100
  }