fix: typescript checks in ci (#364)

* feat: setup schema file as fallback for codegen

* ci: included codegen build script

* fix: biome lint issues

* ci: fix heap memory
This commit is contained in:
Dani Akash
2026-02-27 00:22:59 +05:30
committed by GitHub
parent 1322638681
commit 5d082deca3
5 changed files with 1645 additions and 7 deletions

View File

@@ -42,8 +42,10 @@ jobs:
- name: Install dependencies
run: bun ci
- name: Build Agent SDK package
run: bun run build:agent-sdk
- name: Run codegen
run: bun run --cwd apps/agent codegen
- name: Run Typecheck
run: bun run typecheck
env:
NODE_OPTIONS: --max-old-space-size=4096

View File

@@ -15,7 +15,7 @@ VITE_PUBLIC_SENTRY_DSN=
# BrowserOS API URL
VITE_PUBLIC_BROWSEROS_API=https://api.browseros.com
# GraphQL Schema Path
# GraphQL Schema Path (optional — falls back to schema/schema.graphql)
GRAPHQL_SCHEMA_PATH=
# Sentry build (source maps)

View File

@@ -151,6 +151,14 @@ SENTRY_PROJECT=your-project
SENTRY_AUTH_TOKEN=your-token
```
### GraphQL Schema
Codegen requires a GraphQL schema. By default it uses the bundled `schema/schema.graphql`, so no extra setup is needed. If you have access to the original API source, you can set the following environment variable
```env
GRAPHQL_SCHEMA_PATH=/path/to/api-repo/.../schema.graphql
```
## Scripts
| Script | Description |

View File

@@ -1,3 +1,4 @@
import { existsSync } from 'node:fs'
import path from 'node:path'
import { includeIgnoreFile } from '@eslint/compat'
import type { CodegenConfig } from '@graphql-codegen/cli'
@@ -5,11 +6,12 @@ import type { CodegenConfig } from '@graphql-codegen/cli'
// biome-ignore lint/style/noProcessEnv: env needed for codegen config
const env = process.env
const schemaPath = env.GRAPHQL_SCHEMA_PATH
if (!schemaPath) {
const schemaPath =
env.GRAPHQL_SCHEMA_PATH ?? path.resolve(__dirname, 'schema/schema.graphql')
if (!existsSync(schemaPath)) {
throw new Error(
'GRAPHQL_SCHEMA_PATH is not set. Set it in .env.development to the local path of:\n' +
'https://github.com/browseros-ai/BrowserOS-workers/blob/main/apps/api/src/modules/graphql/schema.graphql',
'No schema found. Either set GRAPHQL_SCHEMA_PATH in .env.development ' +
'or ensure schema/schema.graphql exists',
)
}

File diff suppressed because it is too large Load Diff