@lvnt/release-radar 1.9.9 → 1.9.11

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.
@@ -148,11 +148,10 @@
148
148
  "Pylance": {
149
149
  "displayName": "Pylance",
150
150
  "downloadUrl": "{{MIRROR_URL}}",
151
- "filename": "vscode-pylance-{{VERSION}}-win32-x64.vsix",
151
+ "filename": "vscode-pylance-{{VERSION}}.vsix",
152
152
  "mirror": {
153
153
  "sourceUrl": "marketplace-api",
154
- "extensionId": "ms-python.vscode-pylance",
155
- "targetPlatform": "win32-x64"
154
+ "extensionId": "ms-python.vscode-pylance"
156
155
  }
157
156
  },
158
157
  "isort": {
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Fetches the latest stable release version from a GitHub repository.
3
3
  * Uses /releases/latest endpoint which excludes pre-releases and drafts by design.
4
+ * Set GITHUB_TOKEN env var to avoid rate limits (60/hour unauthenticated, 5000/hour with token).
4
5
  */
5
6
  export declare function fetchGitHubRelease(repo: string): Promise<string>;
@@ -2,17 +2,25 @@
2
2
  /**
3
3
  * Fetches the latest stable release version from a GitHub repository.
4
4
  * Uses /releases/latest endpoint which excludes pre-releases and drafts by design.
5
+ * Set GITHUB_TOKEN env var to avoid rate limits (60/hour unauthenticated, 5000/hour with token).
5
6
  */
6
7
  export async function fetchGitHubRelease(repo) {
7
8
  // Note: /releases/latest only returns stable releases (no pre-releases or drafts)
8
9
  const url = `https://api.github.com/repos/${repo}/releases/latest`;
9
- const response = await fetch(url, {
10
- headers: {
11
- 'Accept': 'application/vnd.github.v3+json',
12
- 'User-Agent': 'ReleaseRadar/1.0'
13
- }
14
- });
10
+ const headers = {
11
+ 'Accept': 'application/vnd.github.v3+json',
12
+ 'User-Agent': 'ReleaseRadar/1.0'
13
+ };
14
+ // Use GitHub token if available to avoid rate limits
15
+ const token = process.env.GITHUB_TOKEN;
16
+ if (token) {
17
+ headers['Authorization'] = `token ${token}`;
18
+ }
19
+ const response = await fetch(url, { headers });
15
20
  if (!response.ok) {
21
+ if (response.status === 403) {
22
+ throw new Error(`GitHub API error: 403 rate limit exceeded. Set GITHUB_TOKEN env var.`);
23
+ }
16
24
  throw new Error(`GitHub API error: ${response.status} ${response.statusText}`);
17
25
  }
18
26
  const data = await response.json();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvnt/release-radar",
3
- "version": "1.9.9",
3
+ "version": "1.9.11",
4
4
  "description": "Monitor tool versions and notify via Telegram when updates are detected",
5
5
  "main": "dist/index.js",
6
6
  "bin": {