Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
af2e099
feat(api): codegen for discussions
setchy Dec 11, 2025
2174ebd
feat(api): codegen for discussions
setchy Dec 11, 2025
6340374
feat(api): codegen for discussions
setchy Dec 11, 2025
6d53584
feat(api): codegen for discussions
setchy Dec 12, 2025
027a3e9
feat(api): codegen for discussions
setchy Dec 12, 2025
fec2a79
feat(api): codegen for discussions
setchy Dec 12, 2025
cc69d14
Merge branch 'main' into feat/codegen-discussions
setchy Dec 12, 2025
07c7f4b
Merge branch 'main' into feat/codegen-discussions
setchy Dec 12, 2025
fe07409
feat(api): codegen for discussions
setchy Dec 12, 2025
4d97973
feat(api): codegen for discussions
setchy Dec 12, 2025
fa5e839
feat(api): codegen for discussions
setchy Dec 12, 2025
4afeac9
feat(api): codegen for discussions
setchy Dec 12, 2025
30403ad
feat(api): codegen for discussions
setchy Dec 12, 2025
a53e65e
feat(api): codegen for discussions
setchy Dec 12, 2025
e03f6ac
feat(api): codegen for discussions
setchy Dec 12, 2025
a866f88
Merge branch 'main' into feat/codegen-discussions
setchy Dec 13, 2025
bef371e
remove comment
setchy Dec 13, 2025
df92643
feat(api): codegen for discussions
setchy Dec 18, 2025
abefe5b
Merge branch 'main' into feat/codegen-discussions
setchy Dec 19, 2025
82085f7
Merge branch 'main' into feat/codegen-discussions
setchy Dec 19, 2025
289f353
feat(api): codegen for discussions
setchy Dec 19, 2025
0084a56
Update helpers.ts
setchy Dec 19, 2025
a348952
Update helpers.ts
setchy Dec 20, 2025
b212c65
reduce fetch size
setchy Dec 20, 2025
319081b
type
setchy Dec 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# GitHub Personal Access Token for GraphQL Codegen
GITHUB_TOKEN=some-pat
17 changes: 4 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,15 @@ build/
# Dependency directories
node_modules/

# Generated GraphQL Files
schema.graphql

# Coverage directory used by tools like istanbul
coverage
*.lcov

# Logs
logs
*.log
npm-debug.log*

# Environment configuration
# Environment properties
.env

# Optional npm cache directory
.npm

# Temporary folders
tmp/
temp/

# Mac Files
.DS_Store
2 changes: 2 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"recommendations": [
"biomejs.biome",
"bradlc.vscode-tailwindcss",
"GraphQL.vscode-graphql",
"GraphQL.vscode-graphql-syntax",
"SonarSource.sonarlint-vscode"
]
}
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ pnpm install
> OAUTH_CLIENT_ID="123" OAUTH_CLIENT_SECRET="456789" pnpm build
> ```

Copy the `.env.template` to `.env` and add update `GITHUB_TOKEN` with a GitHub Personal Access Token. This is used for fetching the latest GitHub GraphQL API schema for `graphql-codegen`.
```shell
GITHUB_TOKEN=<some personal access token>
```

To watch for changes (`webpack`) in the `src` directory:

```shell
Expand Down
3 changes: 3 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
"files": {
"includes": ["**", "!**/generated/**/*"]
},
"assist": {
"actions": {
"source": {
Expand Down
37 changes: 37 additions & 0 deletions codegen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import type { CodegenConfig } from '@graphql-codegen/cli';
import dotenv from 'dotenv';

dotenv.config();

const config: CodegenConfig = {
overwrite: true,
schema: {
'https://api.github.com/graphql': {
// Add a custom header for authorization using your PAT
headers: {
Authorization: `Bearer ${process.env.GITHUB_TOKEN}`,
},
},
},
documents: ['src/renderer/utils/api/**/*.graphql'],
generates: {
'src/renderer/utils/api/graphql/generated/': {
preset: 'client',
presetConfig: {
fragmentMasking: false, // Disables masking
},
config: {
documentMode: 'string',
useTypeImports: true,
},
},
'src/renderer/utils/api/graphql/generated/schema.graphql': {
plugins: ['schema-ast'],
config: {
includeDirectives: true,
},
},
},
};

export default config;
7 changes: 7 additions & 0 deletions graphql.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { IGraphQLConfig } from 'graphql-config';

const config: IGraphQLConfig = {
schema: './src/renderer/utils/api/graphql/generated/schema.graphql',
};

export default config;
16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"build:main": "webpack --config ./config/webpack.config.main.prod.ts",
"build:preload": "webpack --config ./config/webpack.config.preload.prod.ts",
"build:renderer": "webpack --config ./config/webpack.config.renderer.prod.ts",
"watch": "concurrently --names \"main,preload,renderer\" --prefix-colors \"blue,magenta,green\" \"pnpm watch:main\" \"pnpm watch:preload\" \"pnpm watch:renderer\"",
"watch": "concurrently --names \"main,preload,renderer,codegen\" --prefix-colors \"blue,magenta,green,cyan\" \"pnpm watch:main\" \"pnpm watch:preload\" \"pnpm watch:renderer\" \"pnpm watch:codegen\"",
"watch:codegen": "pnpm codegen --watch",
"watch:main": "webpack --watch --config ./config/webpack.config.main.base.ts",
"watch:preload": "webpack --watch --config ./config/webpack.config.preload.base.ts",
"watch:renderer": "webpack --watch --config ./config/webpack.config.renderer.base.ts",
Expand All @@ -20,7 +21,8 @@
"lint": "biome check --fix",
"test": "jest",
"start": "electron . --enable-logging",
"prepare": "husky"
"prepare": "husky",
"codegen": "graphql-codegen --config codegen.ts"
},
"engines": {
"node": ">=24"
Expand Down Expand Up @@ -79,6 +81,9 @@
"@biomejs/biome": "2.3.10",
"@discordapp/twemoji": "16.0.1",
"@electron/notarize": "3.1.1",
"@graphql-codegen/cli": "6.1.0",
"@graphql-codegen/schema-ast": "5.0.0",
"@parcel/watcher": "2.5.1",
"@primer/css": "22.0.2",
"@primer/octicons-react": "19.21.1",
"@primer/primitives": "11.3.2",
Expand All @@ -101,10 +106,11 @@
"css-loader": "7.1.2",
"css-minimizer-webpack-plugin": "7.0.4",
"date-fns": "4.1.0",
"dotenv": "17.2.3",
"electron": "39.2.7",
"electron-builder": "26.0.12",
"final-form": "5.0.0",
"graphql-tag": "2.12.6",
"graphql": "16.12.0",
"html-webpack-plugin": "5.6.5",
"husky": "9.1.7",
"identity-obj-proxy": "3.0.0",
Expand Down Expand Up @@ -132,9 +138,9 @@
"pnpm": {
"onlyBuiltDependencies": [
"@biomejs/biome",
"@parcel/watcher",
"@tailwindcss/oxide",
"electron",
"esbuild"
"electron"
]
},
"lint-staged": {
Expand Down
Loading