Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8050a10
add some benchmark experiments; in-memory caching for dmmf document a…
benminer Sep 23, 2025
0869e0d
remove old benchmarking code; add more versatile benchmarking method
benminer Sep 23, 2025
502512b
revert to sequential code generation after much experimentation
benminer Sep 24, 2025
649740e
cleanup generate-code; fix tests (reset module level caches)
benminer Sep 24, 2025
e3131f1
bump down blacksmith runner
benminer Sep 24, 2025
d1f2235
run format
benminer Sep 24, 2025
54ea253
use ubuntu-latest; disable logging by default on generate
benminer Sep 24, 2025
c7fb91d
run format; remove worker threads references
benminer Sep 24, 2025
a1b0923
update prettier
benminer Sep 24, 2025
3730870
format code
benminer Sep 24, 2025
3654e07
fix: make husky pre-commit hook executable and update lint-staged config
benminer Sep 24, 2025
16cbee2
fix: format all files with prettier and improve npm scripts
benminer Sep 24, 2025
f797531
fix: format package.json
benminer Sep 24, 2025
8f9d3f3
clean: remove debug information from check:format script
benminer Sep 24, 2025
f731f90
fix: setup integration tests to work locally
benminer Sep 24, 2025
34a7b5d
fix: handle Prisma update notifications in integration tests
benminer Sep 24, 2025
a5b6da0
fix: complete integration test setup for local and CI environments
benminer Sep 24, 2025
08ad3ef
update test snapshots
benminer Sep 29, 2025
fcea734
move to blacksmith; setup pg in pull-request.yml
benminer Sep 29, 2025
31feb33
move back to gh runners
benminer Sep 29, 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
3 changes: 3 additions & 0 deletions .cli.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ tests/artifacts
**/prisma/migrations/**/*
prisma-client-mock.js
prisma-client-mock.d.ts

generated-test
test-schemas
27 changes: 18 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
name: CI/CD
name: Deploy

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
check:
# runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x, 21.x, 22.x]
node-version: [20.x, 22.x]

services:
db:
Expand All @@ -27,16 +25,27 @@ jobs:
- 5432:5432

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
- name: Install Node
uses: useblacksmith/setup-node@v5
with:
node-version: ${{ matrix.node-version }}

- name: Cache Dependencies
id: cache-deps
uses: actions/cache@v4
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ matrix.node-version }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ matrix.node-version }}

- name: Setup project
run: |
npm install
npm ci --no-fund --no-audit --no-update-notifier --include=dev --include=optional

- name: Check codebase
run: |
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Pull Request Workflow

on:
pull_request:
branches:
- main
types: [opened, synchronize]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
checks:
# runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-latest

services:
postgres:
image: postgres:15
env:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: typegraphql-prisma
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

strategy:
matrix:
node-version: [20.x, 21.x, 22.x]

steps:
- uses: actions/checkout@v4

- name: Install Node
uses: useblacksmith/setup-node@v5
with:
node-version: ${{ matrix.node-version }}

- name: Cache Dependencies
id: cache-deps
uses: actions/cache@v4
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ matrix.node-version }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ matrix.node-version }}

- name: Setup project
run: |
npm ci --no-fund --no-audit --no-update-notifier --include=dev --include=optional

- name: Check codebase
run: |
npm run check:format
npm run check:type

- name: Run tests
run: |
npm run test:ci
env:
CI: true
TEST_DATABASE_URL: postgresql://user:password@localhost:5432/typegraphql-prisma
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ build
.env.development.local
.env.test.local
.env.production.local

generated-test
Empty file modified .husky/pre-commit
100644 → 100755
Empty file.
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ coverage
**/prisma/migrations/**/*
prisma-client-mock.js
prisma-client-mock.d.ts

generated-test
test-schemas
58 changes: 58 additions & 0 deletions .zed/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"format_on_save": "on",
"lsp": {
"vtsls": {
"settings": {
"typescript": {
"tsserver": {
"maxTsServerMemory": 16184,
"watchOptions": {
"watchFile": "useFsEvents",
"watchDirectory": "useFsEvents",
"fallbackPolling": "dynamicPriority",
"synchronousWatchDirectory": true,
"excludeDirectories": ["**/node_modules", "**/.git"]
}
},
"preferences": {
"includePackageJsonAutoImports": "off"
}
},
"javascript": {
"tsserver": {
"maxTsServerMemory": 16184,
"watchOptions": {
"watchFile": "useFsEvents",
"watchDirectory": "useFsEvents",
"fallbackPolling": "dynamicPriority",
"synchronousWatchDirectory": true,
"excludeDirectories": ["**/node_modules", "**/.git"]
}
},
"preferences": {
"includePackageJsonAutoImports": "off"
}
}
}
}
},
"languages": {
"JavaScript": {
"formatter": { "language_server": { "name": "prettier" } }
},
"TypeScript": {
"show_edit_predictions": true,
"language_servers": ["!typescript-language-server", "vtsls", "..."],
"formatter": { "language_server": { "name": "prettier" } }
},
"TSX": {
"show_edit_predictions": true,
"language_servers": ["!typescript-language-server", "vtsls", "..."],
"formatter": { "language_server": { "name": "prettier" } }
},
"JSON": { "formatter": { "language_server": { "name": "prettier" } } },
"JSONC": { "formatter": { "language_server": { "name": "prettier" } } },
"CSS": { "formatter": { "language_server": { "name": "prettier" } } },
"GraphQL": { "formatter": { "language_server": { "name": "prettier" } } }
}
}
34 changes: 34 additions & 0 deletions docs/basics/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,37 @@ This way you can save even up to 33% of the generation process time.
:::info
When the generator is configured to emit transpiled code, the generated JS code is always formatted by TypeScript compiler and you can't change it to Prettier or disable the formatting by the `formatGeneratedCode` option.
:::

## Verbose logging

By default, the generator runs quietly and only shows essential information. However, during development or debugging, you might want to see detailed timing information and performance metrics for each generation phase.

You can enable verbose logging by setting the `verboseLogging` option to `true`:

```prisma {4}
generator typegraphql {
provider = "typegraphql-prisma"
output = "../prisma/generated/type-graphql"
verboseLogging = true
}
```

When enabled, the generator will output detailed information including:

- Directory setup time
- DMMF generation time
- Configuration parsing time
- Detailed DMMF comparison statistics
- Code generation phase timings
- Performance metrics and insights
- Total generation time breakdown

This is particularly useful for:

- Performance analysis and optimization
- Debugging generation issues
- Understanding which parts of your schema take the most time to process

:::tip
Keep `verboseLogging` disabled in production environments to reduce console noise and improve performance.
:::
Loading