prisma-generator-express 1.64.3 → 1.64.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
Prisma generator that creates Express, Fastify, or Hono CRUD API routes with OpenAPI documentation from your Prisma schema.
|
|
9
9
|
|
|
10
|
+
**Guides:** [Prisma Generator Express Series](https://multipliedtwice.github.io/prisma-generator-express/) — verified tutorials, deep dives, and troubleshooting references.
|
|
11
|
+
|
|
12
|
+
**Article evidence:** [guard lab](article-labs/guard/) and [HTTP/PostgreSQL lab](article-labs/http/).
|
|
13
|
+
|
|
10
14
|
Running `npx prisma generate` produces:
|
|
11
15
|
|
|
12
16
|
- Handler functions for all Prisma operations (findMany, create, update, delete, etc.)
|
|
@@ -3533,4 +3537,4 @@ The dropped runtime must remain self-contained. Generated code must not require
|
|
|
3533
3537
|
|
|
3534
3538
|
## License
|
|
3535
3539
|
|
|
3536
|
-
MIT
|
|
3540
|
+
MIT
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { GeneratorOptions } from '@prisma/generator-helper';
|
|
2
|
-
export declare function generateQueryBuilderHelper(options: GeneratorOptions): string;
|
|
2
|
+
export declare function generateQueryBuilderHelper(options: Pick<GeneratorOptions, 'schemaPath'>): string;
|
|
@@ -52,7 +52,7 @@ export function startQueryBuilder(options: QueryBuilderOptions = {}): void {
|
|
|
52
52
|
|
|
53
53
|
function doStart(options: QueryBuilderOptions): Promise<void> {
|
|
54
54
|
return new Promise<void>((resolvePromise) => {
|
|
55
|
-
const env =
|
|
55
|
+
const env = process.env
|
|
56
56
|
|
|
57
57
|
if (env.NODE_ENV === 'production') {
|
|
58
58
|
resolvePromise()
|
|
@@ -97,7 +97,7 @@ function doStart(options: QueryBuilderOptions): Promise<void> {
|
|
|
97
97
|
|
|
98
98
|
const schemaCwd = dirname(resolve(schemaPath))
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
const child = spawn(process.execPath, [cliPath], {
|
|
101
101
|
stdio: 'inherit',
|
|
102
102
|
env: {
|
|
103
103
|
...env,
|
|
@@ -110,14 +110,15 @@ function doStart(options: QueryBuilderOptions): Promise<void> {
|
|
|
110
110
|
DATABASE_URL: databaseUrl,
|
|
111
111
|
},
|
|
112
112
|
})
|
|
113
|
+
_process = child
|
|
113
114
|
|
|
114
|
-
|
|
115
|
+
child.on('error', (err) => {
|
|
115
116
|
console.error('[query-builder] Failed to start:', err.message)
|
|
116
117
|
_process = null
|
|
117
118
|
resolvePromise()
|
|
118
119
|
})
|
|
119
120
|
|
|
120
|
-
|
|
121
|
+
child.on('exit', (code) => {
|
|
121
122
|
const wasStopping = _stopping
|
|
122
123
|
_stopping = false
|
|
123
124
|
_process = null
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateQueryBuilderHelper.js","sourceRoot":"","sources":["../../src/generators/generateQueryBuilderHelper.ts"],"names":[],"mappings":";;AAEA,
|
|
1
|
+
{"version":3,"file":"generateQueryBuilderHelper.js","sourceRoot":"","sources":["../../src/generators/generateQueryBuilderHelper.ts"],"names":[],"mappings":";;AAEA,gEAmKC;AAnKD,SAAgB,0BAA0B,CACxC,OAA6C;IAE7C,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU;QACnC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC;QACpC,CAAC,CAAC,gDAAgD,CAAA;IAEpD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CA+DsC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4FxD,CAAA;AACD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prisma-generator-express",
|
|
3
3
|
"description": "Prisma generator for Express, Fastify, and Hono CRUD APIs with OpenAPI documentation",
|
|
4
|
-
"version": "1.64.
|
|
4
|
+
"version": "1.64.5",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "MIT",
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { GeneratorOptions } from '@prisma/generator-helper'
|
|
2
2
|
|
|
3
|
-
export function generateQueryBuilderHelper(
|
|
3
|
+
export function generateQueryBuilderHelper(
|
|
4
|
+
options: Pick<GeneratorOptions, 'schemaPath'>,
|
|
5
|
+
): string {
|
|
4
6
|
const schemaPath = options.schemaPath
|
|
5
7
|
? JSON.stringify(options.schemaPath)
|
|
6
8
|
: "resolve(process.cwd(), 'prisma/schema.prisma')"
|
|
@@ -52,7 +54,7 @@ export function startQueryBuilder(options: QueryBuilderOptions = {}): void {
|
|
|
52
54
|
|
|
53
55
|
function doStart(options: QueryBuilderOptions): Promise<void> {
|
|
54
56
|
return new Promise<void>((resolvePromise) => {
|
|
55
|
-
const env =
|
|
57
|
+
const env = process.env
|
|
56
58
|
|
|
57
59
|
if (env.NODE_ENV === 'production') {
|
|
58
60
|
resolvePromise()
|
|
@@ -97,7 +99,7 @@ function doStart(options: QueryBuilderOptions): Promise<void> {
|
|
|
97
99
|
|
|
98
100
|
const schemaCwd = dirname(resolve(schemaPath))
|
|
99
101
|
|
|
100
|
-
|
|
102
|
+
const child = spawn(process.execPath, [cliPath], {
|
|
101
103
|
stdio: 'inherit',
|
|
102
104
|
env: {
|
|
103
105
|
...env,
|
|
@@ -110,14 +112,15 @@ function doStart(options: QueryBuilderOptions): Promise<void> {
|
|
|
110
112
|
DATABASE_URL: databaseUrl,
|
|
111
113
|
},
|
|
112
114
|
})
|
|
115
|
+
_process = child
|
|
113
116
|
|
|
114
|
-
|
|
117
|
+
child.on('error', (err) => {
|
|
115
118
|
console.error('[query-builder] Failed to start:', err.message)
|
|
116
119
|
_process = null
|
|
117
120
|
resolvePromise()
|
|
118
121
|
})
|
|
119
122
|
|
|
120
|
-
|
|
123
|
+
child.on('exit', (code) => {
|
|
121
124
|
const wasStopping = _stopping
|
|
122
125
|
_stopping = false
|
|
123
126
|
_process = null
|
|
@@ -160,4 +163,4 @@ export function stopQueryBuilder(): void {
|
|
|
160
163
|
_process.kill()
|
|
161
164
|
}
|
|
162
165
|
`
|
|
163
|
-
}
|
|
166
|
+
}
|