mirror of
https://github.com/browseros-ai/BrowserOS.git
synced 2026-05-18 02:57:47 +00:00
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:
6
.github/workflows/code-quality.yml
vendored
6
.github/workflows/code-quality.yml
vendored
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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',
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
1626
apps/agent/schema/schema.graphql
Normal file
1626
apps/agent/schema/schema.graphql
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user