Compare commits
2 Commits
dependabot
...
derek/sett
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0939cab8f5 | ||
| f77f663fe7 |
@@ -145,7 +145,7 @@
|
||||
"storybook": "^8.6.0",
|
||||
"typescript": "^5.7.3",
|
||||
"unocss": "^0.63.6",
|
||||
"unocss-preset-primitives": "0.0.2-beta.2",
|
||||
"unocss-preset-primitives": "0.0.2-beta.1",
|
||||
"unplugin-icons": "^0.19.3",
|
||||
"vite": "^5.4.20",
|
||||
"vite-plugin-inspect": "^0.8.9",
|
||||
|
||||
27
pnpm-lock.yaml
generated
27
pnpm-lock.yaml
generated
@@ -363,8 +363,8 @@ importers:
|
||||
specifier: ^0.63.6
|
||||
version: 0.63.6(postcss@8.5.3)(rollup@4.52.4)(typescript@5.7.3)(vite@5.4.20(@types/node@22.13.5)(sass@1.85.1)(terser@5.44.0))
|
||||
unocss-preset-primitives:
|
||||
specifier: 0.0.2-beta.2
|
||||
version: 0.0.2-beta.2(@unocss/core@0.63.6)
|
||||
specifier: 0.0.2-beta.1
|
||||
version: 0.0.2-beta.1
|
||||
unplugin-icons:
|
||||
specifier: ^0.19.3
|
||||
version: 0.19.3(@svgr/core@8.1.0(typescript@5.7.3))(@vue/compiler-sfc@3.5.13)
|
||||
@@ -2314,8 +2314,8 @@ packages:
|
||||
'@types/node@22.13.5':
|
||||
resolution: {integrity: sha512-+lTU0PxZXn0Dr1NBtC7Y8cR21AJr87dLLU953CWA6pMxxv/UDc7jYAY90upcrie1nRcD6XNG5HOYEDtgW5TxAg==}
|
||||
|
||||
'@types/node@22.18.11':
|
||||
resolution: {integrity: sha512-Gd33J2XIrXurb+eT2ktze3rJAfAp9ZNjlBdh4SVgyrKEOADwCbdUDaK7QgJno8Ue4kcajscsKqu6n8OBG3hhCQ==}
|
||||
'@types/node@22.18.10':
|
||||
resolution: {integrity: sha512-anNG/V/Efn/YZY4pRzbACnKxNKoBng2VTFydVu8RRs5hQjikP8CQfaeAV59VFSCzKNp90mXiVXW2QzV56rwMrg==}
|
||||
|
||||
'@types/normalize-package-data@2.4.4':
|
||||
resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==}
|
||||
@@ -2518,6 +2518,9 @@ packages:
|
||||
resolution: {integrity: sha512-+4Lt5uTwRgu1z7vhOUzDf+mL+BQYdaa/Z8NMT2Fiqb37tcjEKvmwaUHdfE22Vif1luDgC6xqFsn6qqFtOxhoWQ==}
|
||||
engines: {node: '>=14'}
|
||||
|
||||
'@unocss/core@0.61.9':
|
||||
resolution: {integrity: sha512-2W1YZQIWXcueGdbXU/ZCqn/8yQhWk8e8kAHFkVlbc9rictkd2UmPB9nIZ8Ii1tMwt6F0TT6vfHbLJEGCV08o2g==}
|
||||
|
||||
'@unocss/core@0.63.6':
|
||||
resolution: {integrity: sha512-Q4QPgJ271Up89+vIqqOKgtdCKkFpHqvHN8W1LUlKPqtYnOvVYaOIVNAZowaIdEhPuc83yLc6Tg2+7riK18QKEw==}
|
||||
|
||||
@@ -6986,10 +6989,8 @@ packages:
|
||||
resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==}
|
||||
engines: {node: '>= 10.0.0'}
|
||||
|
||||
unocss-preset-primitives@0.0.2-beta.2:
|
||||
resolution: {integrity: sha512-wFgm6lJX1r2chTgEeSMl8E/AJKSsOZaRI6AYU/7IItKgVplMfy7h/T5EMCJlw7RSLrWc4vtbkHPmIK8OzokzWw==}
|
||||
peerDependencies:
|
||||
'@unocss/core': '>=0.59.0 < 101'
|
||||
unocss-preset-primitives@0.0.2-beta.1:
|
||||
resolution: {integrity: sha512-bGNUK8G1V720gPe0ToOKEeMQqgJsDIBz6IuSRDQNBVBvWVx/OzXtsn6hjkKlhw/TjROSawaxpwcULRoPAZ5Gvg==}
|
||||
|
||||
unocss@0.63.6:
|
||||
resolution: {integrity: sha512-OKJJKEFWVz+Lsf3JdOgRiRtL+QOUQRBov89taUcCPFPZtrhP6pPVFCZHD9qMvY4IChMX7dzalQax3ZXJ3hbtkQ==}
|
||||
@@ -9273,7 +9274,7 @@ snapshots:
|
||||
dependencies:
|
||||
undici-types: 6.20.0
|
||||
|
||||
'@types/node@22.18.11':
|
||||
'@types/node@22.18.10':
|
||||
dependencies:
|
||||
undici-types: 6.21.0
|
||||
|
||||
@@ -9552,6 +9553,8 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@unocss/core@0.61.9': {}
|
||||
|
||||
'@unocss/core@0.63.6': {}
|
||||
|
||||
'@unocss/eslint-config@0.63.6(eslint@8.57.1)(typescript@5.7.3)':
|
||||
@@ -12450,7 +12453,7 @@ snapshots:
|
||||
|
||||
jest-worker@27.5.1:
|
||||
dependencies:
|
||||
'@types/node': 22.18.11
|
||||
'@types/node': 22.18.10
|
||||
merge-stream: 2.0.0
|
||||
supports-color: 8.1.1
|
||||
|
||||
@@ -14812,9 +14815,9 @@ snapshots:
|
||||
|
||||
universalify@2.0.1: {}
|
||||
|
||||
unocss-preset-primitives@0.0.2-beta.2(@unocss/core@0.63.6):
|
||||
unocss-preset-primitives@0.0.2-beta.1:
|
||||
dependencies:
|
||||
'@unocss/core': 0.63.6
|
||||
'@unocss/core': 0.61.9
|
||||
|
||||
unocss@0.63.6(postcss@8.5.3)(rollup@4.52.4)(typescript@5.7.3)(vite@5.4.20(@types/node@22.13.5)(sass@1.85.1)(terser@5.44.0)):
|
||||
dependencies:
|
||||
|
||||
@@ -9,6 +9,7 @@ import onUpdate from './events/onUpdate';
|
||||
import browserActionHandler from './handler/browserActionHandler';
|
||||
import calendarBackgroundHandler from './handler/calendarBackgroundHandler';
|
||||
import CESHandler from './handler/CESHandler';
|
||||
import gitHubStatsHandler from './handler/gitHubStatsHandler';
|
||||
import tabManagementHandler from './handler/tabManagementHandler';
|
||||
import userScheduleHandler from './handler/userScheduleHandler';
|
||||
|
||||
@@ -52,6 +53,7 @@ const messageListener = new MessageListener<BACKGROUND_MESSAGES>({
|
||||
...userScheduleHandler,
|
||||
...CESHandler,
|
||||
...calendarBackgroundHandler,
|
||||
...gitHubStatsHandler,
|
||||
});
|
||||
|
||||
messageListener.listen();
|
||||
|
||||
31
src/pages/background/handler/gitHubStatsHandler.ts
Normal file
31
src/pages/background/handler/gitHubStatsHandler.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type GitHubStatsMessages from '@shared/messages/GitHubStatsMessages';
|
||||
import { GitHubStatsService } from '@views/lib/getGitHubStats';
|
||||
import type { MessageHandler } from 'chrome-extension-toolkit';
|
||||
|
||||
const gitHubStatsService = new GitHubStatsService();
|
||||
|
||||
/**
|
||||
* Handler for GitHub stats related messages
|
||||
*/
|
||||
const gitHubStatsHandler: MessageHandler<GitHubStatsMessages> = {
|
||||
async fetchGitHubStats({ data, sendResponse }) {
|
||||
try {
|
||||
const includeMergedPRs = data ?? false;
|
||||
const stats = await gitHubStatsService.fetchGitHubStats({ includeMergedPRs });
|
||||
sendResponse(stats);
|
||||
} catch (error) {
|
||||
console.error('Error fetching GitHub stats in background:', error);
|
||||
sendResponse({
|
||||
adminGitHubStats: {},
|
||||
userGitHubStats: {},
|
||||
contributors: [],
|
||||
names: {},
|
||||
dataFetched: new Date(),
|
||||
lastUpdated: new Date(),
|
||||
isCached: false,
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default gitHubStatsHandler;
|
||||
14
src/shared/messages/GitHubStatsMessages.ts
Normal file
14
src/shared/messages/GitHubStatsMessages.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { GitHubStatsService } from '@views/lib/getGitHubStats';
|
||||
|
||||
/* eslint-disable jsdoc/require-jsdoc */
|
||||
|
||||
export type GitHubStatsResult = Awaited<ReturnType<GitHubStatsService['fetchGitHubStats']>>;
|
||||
|
||||
export default interface GitHubStatsMessages {
|
||||
/**
|
||||
* Fetch GitHub statistics for all contributors
|
||||
* @param includeMergedPRs - Whether to include merged PR counts (optional, default: false)
|
||||
* @returns GitHub stats including commits, lines added/deleted, and optionally merged PRs
|
||||
*/
|
||||
fetchGitHubStats: (includeMergedPRs?: boolean) => GitHubStatsResult;
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import { createMessenger } from 'chrome-extension-toolkit';
|
||||
import type BrowserActionMessages from './BrowserActionMessages';
|
||||
import type { CalendarBackgroundMessages, CalendarTabMessages } from './CalendarMessages';
|
||||
import type CESMessage from './CESMessage';
|
||||
import type GitHubStatsMessages from './GitHubStatsMessages';
|
||||
import type TabInfoMessages from './TabInfoMessages';
|
||||
import type TabManagementMessages from './TabManagementMessages';
|
||||
import type { UserScheduleMessages } from './UserScheduleMessages';
|
||||
@@ -14,7 +15,8 @@ export type BACKGROUND_MESSAGES = BrowserActionMessages &
|
||||
TabManagementMessages &
|
||||
UserScheduleMessages &
|
||||
CESMessage &
|
||||
CalendarBackgroundMessages;
|
||||
CalendarBackgroundMessages &
|
||||
GitHubStatsMessages;
|
||||
|
||||
/**
|
||||
* This is a type with all the message definitions that can be sent TO specific tabs
|
||||
|
||||
Reference in New Issue
Block a user