Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Use Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "turbo run build",
"watch": "turbo run watch build",
"lint": "turbo run lint",
"test": "vitest run",
"test": "turbo run test",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"pr": "gh pr create --fill-first --base dev",
"merge-main": "gh pr create --title \"merge dev to main\" --body \"\" --base main --head dev",
Expand Down
9 changes: 4 additions & 5 deletions packages/testtools/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ export function getTestDbProvider() {
return val as 'sqlite' | 'postgresql';
}

const TEST_PG_CONFIG = {
export const TEST_PG_CONFIG = {
host: process.env['TEST_PG_HOST'] ?? 'localhost',
port: process.env['TEST_PG_PORT'] ? parseInt(process.env['TEST_PG_PORT']) : 5432,
user: process.env['TEST_PG_USER'] ?? 'postgres',
password: process.env['TEST_PG_PASSWORD'] ?? 'postgres',
};

export const TEST_PG_URL = `postgres://${TEST_PG_CONFIG.user}:${TEST_PG_CONFIG.password}@${TEST_PG_CONFIG.host}:${TEST_PG_CONFIG.port}`;

type ExtraTestClientOptions = {
/**
* Database provider
Expand Down Expand Up @@ -104,10 +106,7 @@ export async function createTestClient(
let _schema: SchemaDef;
const provider = options?.provider ?? getTestDbProvider() ?? 'sqlite';
const dbName = options?.dbName ?? getTestDbName(provider);
const dbUrl =
provider === 'sqlite'
? `file:${dbName}`
: `postgres://${TEST_PG_CONFIG.user}:${TEST_PG_CONFIG.password}@${TEST_PG_CONFIG.host}:${TEST_PG_CONFIG.port}/${dbName}`;
const dbUrl = provider === 'sqlite' ? `file:${dbName}` : `${TEST_PG_URL}/${dbName}`;

let model: Model | undefined;

Expand Down
96 changes: 76 additions & 20 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 20 additions & 19 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,29 @@ packages:
- packages/**
- samples/**
- tests/**

catalog:
'@tanstack/react-query': 5.90.6
'@types/better-sqlite3': ^7.6.13
'@types/node': ^20.19.0
'@types/react': 19.2.0
'@types/react-dom': 19.2.0
'@types/tmp': ^0.2.6
better-sqlite3: ^12.2.0
decimal.js: ^10.4.3
kysely: ~0.28.8
zod: ^4.0.0
prisma: ^6.19.0
langium: 3.5.0
langium-cli: 3.5.0
ts-pattern: ^5.7.1
typescript: ^5.9.3
'@types/node': ^20.19.0
tmp: ^0.2.3
'@types/tmp': ^0.2.6
'zod-validation-error': ^4.0.1
'better-sqlite3': ^12.2.0
'@types/better-sqlite3': ^7.6.13
'pg': ^8.13.1
'sql.js': ^1.13.0
'decimal.js': '^10.4.3'
next: 16.0.1
pg: ^8.13.1
prisma: ^6.19.0
react: 19.2.0
'@types/react': 19.2.0
react-dom: 19.2.0
'@types/react-dom': 19.2.0
'@tanstack/react-query': 5.90.6
'next': 16.0.1
'vue': 3.5.22
'svelte': 5.43.3
sql.js: ^1.13.0
svelte: 5.43.3
tmp: ^0.2.3
ts-pattern: ^5.7.1
typescript: ^5.9.3
vue: 3.5.22
zod: ^4.0.0
zod-validation-error: ^4.0.1
Loading