@stryke/prisma-trpc-generator 0.2.1 → 0.2.3

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/dist/index.js CHANGED
@@ -1,6 +1,502 @@
1
- import "./chunk-6UJ53OQ6.js";
2
- import "./chunk-GQ7ABBSV.js";
3
- import "./chunk-V6DNCMCB.js";
4
- import "./chunk-RYVIOFDO.js";
5
- import "./chunk-LVOPI6NH.js";
6
- import "./chunk-SHUYVCID.js";
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+
4
+ // src/index.ts
5
+ import { generatorHandler } from "@prisma/generator-helper";
6
+
7
+ // src/prisma-generator.ts
8
+ import { getDMMF, parseEnvValue as parseEnvValue2 } from "@prisma/internals";
9
+ import { promises as fs2 } from "node:fs";
10
+ import path3 from "node:path";
11
+ import pluralize from "pluralize";
12
+ import { generate as PrismaTrpcShieldGenerator } from "prisma-trpc-shield-generator/lib/prisma-generator";
13
+ import { generate as PrismaZodGenerator } from "prisma-zod-generator/lib/prisma-generator";
14
+
15
+ // src/config.ts
16
+ import { DMMF } from "@prisma/generator-helper";
17
+ import { z } from "zod";
18
+ var configBoolean = z.enum([
19
+ "true",
20
+ "false"
21
+ ]).transform((arg) => JSON.parse(arg));
22
+ var configMiddleware = z.union([
23
+ configBoolean,
24
+ z.string().default("../../../../src/middleware")
25
+ ]);
26
+ var configShield = z.union([
27
+ configBoolean,
28
+ z.string().default("../../../../src/shield")
29
+ ]);
30
+ var modelActionEnum = z.nativeEnum(DMMF.ModelAction);
31
+ var configSchema = z.object({
32
+ withMiddleware: configMiddleware.default("true"),
33
+ withShield: configShield.default("true"),
34
+ withZod: configBoolean.default("true"),
35
+ contextPath: z.string().default("../../../../src/context"),
36
+ trpcOptionsPath: z.string().optional(),
37
+ showModelNameInProcedure: configBoolean.default("true"),
38
+ generateModelActions: z.string().default(Object.values(DMMF.ModelAction).join(",")).transform((arg) => {
39
+ return arg.split(",").map((action) => modelActionEnum.parse(action.trim()));
40
+ })
41
+ });
42
+
43
+ // src/helpers.ts
44
+ import { parseEnvValue } from "@prisma/internals";
45
+
46
+ // src/utils/getRelativePath.ts
47
+ import path from "node:path";
48
+ function getRelativePath(outputPath, filePath, isOutsideOutputPath, schemaPath) {
49
+ const fromPath = path.join(outputPath, "routers", "helpers");
50
+ let toPath = path.join(outputPath, filePath);
51
+ if (isOutsideOutputPath) {
52
+ const schemaPathSplit = schemaPath?.split(path.sep);
53
+ const schemaPathWithoutFileAndExtension = schemaPathSplit.slice(0, schemaPathSplit.length - 1).join(path.posix.sep);
54
+ toPath = path.join(schemaPathWithoutFileAndExtension, filePath);
55
+ }
56
+ const newPath = path.relative(fromPath, toPath).split(path.sep).join(path.posix.sep);
57
+ return newPath;
58
+ }
59
+ __name(getRelativePath, "getRelativePath");
60
+
61
+ // src/utils/uncapitalizeFirstLetter.ts
62
+ var uncapitalizeFirstLetter = /* @__PURE__ */ __name((str) => {
63
+ return str.charAt(0).toLowerCase() + str.slice(1);
64
+ }, "uncapitalizeFirstLetter");
65
+
66
+ // src/helpers.ts
67
+ var getProcedureName = /* @__PURE__ */ __name((config) => {
68
+ return config.withShield ? "shieldedProcedure" : config.withMiddleware ? "protectedProcedure" : "publicProcedure";
69
+ }, "getProcedureName");
70
+ var generateCreateRouterImport = /* @__PURE__ */ __name(({ sourceFile, config }) => {
71
+ const imports = [
72
+ "t"
73
+ ];
74
+ if (config) {
75
+ imports.push(getProcedureName(config));
76
+ }
77
+ sourceFile.addImportDeclaration({
78
+ moduleSpecifier: "./helpers/createRouter",
79
+ namedImports: imports
80
+ });
81
+ }, "generateCreateRouterImport");
82
+ var generateRPCImport = /* @__PURE__ */ __name((sourceFile) => {
83
+ sourceFile.addImportDeclaration({
84
+ moduleSpecifier: "@trpc/server",
85
+ namespaceImport: "trpc"
86
+ });
87
+ }, "generateRPCImport");
88
+ var generateShieldImport = /* @__PURE__ */ __name((sourceFile, options, value) => {
89
+ const outputDir = parseEnvValue(options.generator.output);
90
+ let shieldPath = getRelativePath(outputDir, "shield/shield");
91
+ if (typeof value === "string") {
92
+ shieldPath = getRelativePath(outputDir, value, true, options.schemaPath);
93
+ }
94
+ sourceFile.addImportDeclaration({
95
+ moduleSpecifier: shieldPath,
96
+ namedImports: [
97
+ "permissions"
98
+ ]
99
+ });
100
+ }, "generateShieldImport");
101
+ var generateRouterImport = /* @__PURE__ */ __name((sourceFile, modelNamePlural, modelNameCamelCase) => {
102
+ sourceFile.addImportDeclaration({
103
+ moduleSpecifier: `./${modelNameCamelCase}.router`,
104
+ namedImports: [
105
+ `${modelNamePlural}Router`
106
+ ]
107
+ });
108
+ }, "generateRouterImport");
109
+ function generateBaseRouter(sourceFile, config, options) {
110
+ const outputDir = parseEnvValue(options.generator.output);
111
+ sourceFile.addStatements(
112
+ /* ts */
113
+ `
114
+ import type { Context } from '${getRelativePath(outputDir, config.contextPath, true, options.schemaPath)}';
115
+ `
116
+ );
117
+ if (config.trpcOptionsPath) {
118
+ sourceFile.addStatements(
119
+ /* ts */
120
+ `
121
+ import trpcOptions from '${getRelativePath(outputDir, config.trpcOptionsPath, true, options.schemaPath)}';
122
+ `
123
+ );
124
+ }
125
+ sourceFile.addStatements(
126
+ /* ts */
127
+ `
128
+ export const t = trpc.initTRPC.context<Context>().create(${config.trpcOptionsPath ? "trpcOptions" : ""});
129
+ `
130
+ );
131
+ const middlewares = [];
132
+ if (config.withMiddleware && typeof config.withMiddleware === "boolean") {
133
+ sourceFile.addStatements(
134
+ /* ts */
135
+ `
136
+ export const globalMiddleware = t.middleware(async ({ ctx, next }) => {
137
+ console.log('inside middleware!')
138
+ return next()
139
+ });`
140
+ );
141
+ middlewares.push({
142
+ type: "global",
143
+ value: (
144
+ /* ts */
145
+ `.use(globalMiddleware)`
146
+ )
147
+ });
148
+ }
149
+ if (config.withMiddleware && typeof config.withMiddleware === "string") {
150
+ sourceFile.addStatements(
151
+ /* ts */
152
+ `
153
+ import defaultMiddleware from '${getRelativePath(outputDir, config.withMiddleware, true, options.schemaPath)}';
154
+ `
155
+ );
156
+ sourceFile.addStatements(
157
+ /* ts */
158
+ `
159
+ export const globalMiddleware = t.middleware(defaultMiddleware);`
160
+ );
161
+ middlewares.push({
162
+ type: "global",
163
+ value: (
164
+ /* ts */
165
+ `.use(globalMiddleware)`
166
+ )
167
+ });
168
+ }
169
+ if (config.withShield) {
170
+ sourceFile.addStatements(
171
+ /* ts */
172
+ `
173
+ export const permissionsMiddleware = t.middleware(permissions); `
174
+ );
175
+ middlewares.push({
176
+ type: "shield",
177
+ value: (
178
+ /* ts */
179
+ `
180
+ .use(permissions)`
181
+ )
182
+ });
183
+ }
184
+ sourceFile.addStatements(
185
+ /* ts */
186
+ `
187
+ export const publicProcedure = t.procedure; `
188
+ );
189
+ if (middlewares.length > 0) {
190
+ const procName = getProcedureName(config);
191
+ middlewares.forEach((middleware, i) => {
192
+ if (i === 0) {
193
+ sourceFile.addStatements(
194
+ /* ts */
195
+ `
196
+ export const ${procName} = t.procedure
197
+ `
198
+ );
199
+ }
200
+ sourceFile.addStatements(
201
+ /* ts */
202
+ `
203
+ .use(${middleware.type === "shield" ? "permissionsMiddleware" : "globalMiddleware"})
204
+ `
205
+ );
206
+ });
207
+ }
208
+ }
209
+ __name(generateBaseRouter, "generateBaseRouter");
210
+ function generateProcedure(sourceFile, name, typeName, modelName, opType, baseOpType, config) {
211
+ let input = `input${!config.withZod ? " as any" : ""}`;
212
+ const nameWithoutModel = name.replace(modelName, "");
213
+ if (nameWithoutModel === "groupBy" && config.withZod) {
214
+ input = "{ where: input.where, orderBy: input.orderBy, by: input.by, having: input.having, take: input.take, skip: input.skip }";
215
+ }
216
+ sourceFile.addStatements(
217
+ /* ts */
218
+ `${config.showModelNameInProcedure ? name : nameWithoutModel}: ${getProcedureName(config)}
219
+ ${config.withZod ? `.input(${typeName})` : ""}.${getProcedureTypeByOpName(baseOpType)}(async ({ ctx, input }) => {
220
+ const ${name} = await ctx.prisma.${uncapitalizeFirstLetter(modelName)}.${opType.replace("One", "")}(${input});
221
+ return ${name};
222
+ }),`
223
+ );
224
+ }
225
+ __name(generateProcedure, "generateProcedure");
226
+ function generateRouterSchemaImports(sourceFile, modelName, modelActions) {
227
+ sourceFile.addStatements(
228
+ /* ts */
229
+ [
230
+ // remove any duplicate import statements
231
+ ...new Set(modelActions.map((opName) => getRouterSchemaImportByOpName(opName, modelName)))
232
+ ].join("\n")
233
+ );
234
+ }
235
+ __name(generateRouterSchemaImports, "generateRouterSchemaImports");
236
+ var getRouterSchemaImportByOpName = /* @__PURE__ */ __name((opName, modelName) => {
237
+ const opType = opName.replace("OrThrow", "");
238
+ const inputType = getInputTypeByOpName(opType, modelName);
239
+ return inputType ? `import { ${inputType} } from "../schemas/${opType}${modelName}.schema"; ` : "";
240
+ }, "getRouterSchemaImportByOpName");
241
+ var getInputTypeByOpName = /* @__PURE__ */ __name((opName, modelName) => {
242
+ let inputType;
243
+ switch (opName) {
244
+ case "findUnique":
245
+ inputType = `${modelName}FindUniqueSchema`;
246
+ break;
247
+ case "findFirst":
248
+ inputType = `${modelName}FindFirstSchema`;
249
+ break;
250
+ case "findMany":
251
+ inputType = `${modelName}FindManySchema`;
252
+ break;
253
+ case "findRaw":
254
+ inputType = `${modelName}FindRawObjectSchema`;
255
+ break;
256
+ case "createOne":
257
+ inputType = `${modelName}CreateOneSchema`;
258
+ break;
259
+ case "createMany":
260
+ inputType = `${modelName}CreateManySchema`;
261
+ break;
262
+ case "deleteOne":
263
+ inputType = `${modelName}DeleteOneSchema`;
264
+ break;
265
+ case "updateOne":
266
+ inputType = `${modelName}UpdateOneSchema`;
267
+ break;
268
+ case "deleteMany":
269
+ inputType = `${modelName}DeleteManySchema`;
270
+ break;
271
+ case "updateMany":
272
+ inputType = `${modelName}UpdateManySchema`;
273
+ break;
274
+ case "upsertOne":
275
+ inputType = `${modelName}UpsertSchema`;
276
+ break;
277
+ case "aggregate":
278
+ inputType = `${modelName}AggregateSchema`;
279
+ break;
280
+ case "aggregateRaw":
281
+ inputType = `${modelName}AggregateRawObjectSchema`;
282
+ break;
283
+ case "groupBy":
284
+ inputType = `${modelName}GroupBySchema`;
285
+ break;
286
+ default:
287
+ console.log("getInputTypeByOpName: ", {
288
+ opName,
289
+ modelName
290
+ });
291
+ }
292
+ return inputType;
293
+ }, "getInputTypeByOpName");
294
+ var getProcedureTypeByOpName = /* @__PURE__ */ __name((opName) => {
295
+ let procType;
296
+ switch (opName) {
297
+ case "findUnique":
298
+ case "findFirst":
299
+ case "findMany":
300
+ case "findRaw":
301
+ case "aggregate":
302
+ case "aggregateRaw":
303
+ case "groupBy":
304
+ procType = "query";
305
+ break;
306
+ case "createOne":
307
+ case "createMany":
308
+ case "deleteOne":
309
+ case "updateOne":
310
+ case "deleteMany":
311
+ case "updateMany":
312
+ case "upsertOne":
313
+ procType = "mutation";
314
+ break;
315
+ default:
316
+ console.log("getProcedureTypeByOpName: ", {
317
+ opName
318
+ });
319
+ }
320
+ return procType;
321
+ }, "getProcedureTypeByOpName");
322
+ function resolveModelsComments(models, hiddenModels) {
323
+ const modelAttributeRegex = /(?:@@Gen\.)+[A-z]+\(.+\)/;
324
+ const attributeNameRegex = /\.+[A-Z]+\(+/i;
325
+ const attributeArgsRegex = /\(+[A-Z]+:.+\)/i;
326
+ for (const model of models) {
327
+ if (model.documentation) {
328
+ const attribute = model.documentation?.match(modelAttributeRegex)?.[0];
329
+ const attributeName = attribute?.match(attributeNameRegex)?.[0]?.slice(1, -1);
330
+ if (attributeName !== "model") continue;
331
+ const rawAttributeArgs = attribute?.match(attributeArgsRegex)?.[0]?.slice(1, -1);
332
+ const parsedAttributeArgs = {};
333
+ if (rawAttributeArgs) {
334
+ const rawAttributeArgsParts = rawAttributeArgs.split(":").map((it) => it.trim()).map((part) => part.startsWith("[") ? part : part.split(",")).flat().map((it) => it.trim());
335
+ for (let i = 0; i < rawAttributeArgsParts.length; i += 2) {
336
+ const key = rawAttributeArgsParts[i];
337
+ const value = rawAttributeArgsParts[i + 1];
338
+ parsedAttributeArgs[key] = JSON.parse(value);
339
+ }
340
+ }
341
+ if (parsedAttributeArgs.hide) {
342
+ hiddenModels.push(model.name);
343
+ }
344
+ }
345
+ }
346
+ }
347
+ __name(resolveModelsComments, "resolveModelsComments");
348
+
349
+ // src/project.ts
350
+ import { ModuleKind, Project, ScriptTarget } from "ts-morph";
351
+ var compilerOptions = {
352
+ target: ScriptTarget.ES2019,
353
+ module: ModuleKind.CommonJS,
354
+ emitDecoratorMetadata: true,
355
+ experimentalDecorators: true,
356
+ esModuleInterop: true
357
+ };
358
+ var project = new Project({
359
+ compilerOptions: {
360
+ ...compilerOptions
361
+ }
362
+ });
363
+
364
+ // src/utils/removeDir.ts
365
+ import { promises as fs } from "node:fs";
366
+ import path2 from "node:path";
367
+ async function removeDir(dirPath, onlyContent) {
368
+ const dirEntries = await fs.readdir(dirPath, {
369
+ withFileTypes: true
370
+ });
371
+ await Promise.all(dirEntries.map(async (dirEntry) => {
372
+ const fullPath = path2.join(dirPath, dirEntry.name);
373
+ return dirEntry.isDirectory() ? removeDir(fullPath, false) : fs.unlink(fullPath);
374
+ }));
375
+ if (!onlyContent) {
376
+ await fs.rmdir(dirPath);
377
+ }
378
+ }
379
+ __name(removeDir, "removeDir");
380
+
381
+ // src/prisma-generator.ts
382
+ async function generate(options) {
383
+ const outputDir = parseEnvValue2(options.generator.output);
384
+ const results = configSchema.safeParse(options.generator.config);
385
+ if (!results.success) throw new Error("Invalid options passed");
386
+ const config = results.data;
387
+ await fs2.mkdir(outputDir, {
388
+ recursive: true
389
+ });
390
+ await removeDir(outputDir, true);
391
+ if (config.withZod) {
392
+ await PrismaZodGenerator(options);
393
+ }
394
+ if (config.withShield === true) {
395
+ const shieldOutputPath = path3.join(outputDir, "./shield");
396
+ await PrismaTrpcShieldGenerator({
397
+ ...options,
398
+ generator: {
399
+ ...options.generator,
400
+ output: {
401
+ ...options.generator.output,
402
+ value: shieldOutputPath
403
+ },
404
+ config: {
405
+ ...options.generator.config,
406
+ contextPath: config.contextPath
407
+ }
408
+ }
409
+ });
410
+ }
411
+ const prismaClientProvider = options.otherGenerators.find((it) => parseEnvValue2(it.provider) === "prisma-client-js");
412
+ const prismaClientDmmf = await getDMMF({
413
+ datamodel: options.datamodel,
414
+ previewFeatures: prismaClientProvider?.previewFeatures
415
+ });
416
+ const modelOperations = prismaClientDmmf.mappings.modelOperations;
417
+ const models = prismaClientDmmf.datamodel.models;
418
+ const hiddenModels = [];
419
+ resolveModelsComments(models, hiddenModels);
420
+ const createRouter = project.createSourceFile(path3.resolve(outputDir, "routers", "helpers", "createRouter.ts"), void 0, {
421
+ overwrite: true
422
+ });
423
+ generateRPCImport(createRouter);
424
+ if (config.withShield) {
425
+ generateShieldImport(createRouter, options, config.withShield);
426
+ }
427
+ generateBaseRouter(createRouter, config, options);
428
+ createRouter.formatText({
429
+ indentSize: 2
430
+ });
431
+ const appRouter = project.createSourceFile(path3.resolve(outputDir, "routers", `index.ts`), void 0, {
432
+ overwrite: true
433
+ });
434
+ generateCreateRouterImport({
435
+ sourceFile: appRouter
436
+ });
437
+ const routerStatements = [];
438
+ for (const modelOperation of modelOperations) {
439
+ const { model, ...operations } = modelOperation;
440
+ if (hiddenModels.includes(model)) continue;
441
+ const modelActions = Object.keys(operations).filter((opType) => config.generateModelActions.includes(opType.replace("One", "")));
442
+ if (!modelActions.length) continue;
443
+ const plural = pluralize(model.toLowerCase());
444
+ generateRouterImport(appRouter, plural, model);
445
+ const modelRouter = project.createSourceFile(path3.resolve(outputDir, "routers", `${model}.router.ts`), void 0, {
446
+ overwrite: true
447
+ });
448
+ generateCreateRouterImport({
449
+ sourceFile: modelRouter,
450
+ config
451
+ });
452
+ if (config.withZod) {
453
+ generateRouterSchemaImports(modelRouter, model, modelActions);
454
+ }
455
+ modelRouter.addStatements(
456
+ /* ts */
457
+ `
458
+ export const ${plural}Router = t.router({`
459
+ );
460
+ for (const opType of modelActions) {
461
+ const opNameWithModel = operations[opType];
462
+ const baseOpType = opType.replace("OrThrow", "");
463
+ generateProcedure(modelRouter, opNameWithModel, getInputTypeByOpName(baseOpType, model), model, opType, baseOpType, config);
464
+ }
465
+ modelRouter.addStatements(
466
+ /* ts */
467
+ `
468
+ })`
469
+ );
470
+ modelRouter.formatText({
471
+ indentSize: 2
472
+ });
473
+ routerStatements.push(
474
+ /* ts */
475
+ `
476
+ ${model.toLowerCase()}: ${plural}Router`
477
+ );
478
+ }
479
+ appRouter.addStatements(
480
+ /* ts */
481
+ `
482
+ export const appRouter = t.router({${routerStatements.join()}})
483
+ `
484
+ );
485
+ appRouter.formatText({
486
+ indentSize: 2
487
+ });
488
+ await project.save();
489
+ }
490
+ __name(generate, "generate");
491
+
492
+ // src/index.ts
493
+ generatorHandler({
494
+ onManifest: /* @__PURE__ */ __name(() => ({
495
+ defaultOutput: "./generated",
496
+ prettyName: "Prisma tRPC Generator",
497
+ requiresGenerators: [
498
+ "prisma-client-js"
499
+ ]
500
+ }), "onManifest"),
501
+ onGenerate: generate
502
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/prisma-trpc-generator",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "type": "module",
5
5
  "description": "A fork of the prisma-trpc-generator code to work in ESM.",
6
6
  "repository": {
@@ -46,43 +46,39 @@
46
46
  "main": "./dist/index.cjs",
47
47
  "module": "./dist/index.js",
48
48
  "exports": {
49
- "./project": {
50
- "import": "./dist/project.js",
51
- "require": "./dist/project.cjs",
52
- "default": "./dist/project.js"
53
- },
54
- "./prisma-generator": {
55
- "import": "./dist/prisma-generator.js",
56
- "require": "./dist/prisma-generator.cjs",
57
- "default": "./dist/prisma-generator.js"
49
+ ".": {
50
+ "import": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
51
+ "require": {
52
+ "types": "./dist/index.d.cts",
53
+ "default": "./dist/index.cjs"
54
+ },
55
+ "default": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }
58
56
  },
59
57
  "./index": {
60
- "import": "./dist/index.js",
61
- "require": "./dist/index.cjs",
62
- "default": "./dist/index.js"
63
- },
64
- "./helpers": {
65
- "import": "./dist/helpers.js",
66
- "require": "./dist/helpers.cjs",
67
- "default": "./dist/helpers.js"
58
+ "import": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
59
+ "require": {
60
+ "types": "./dist/index.d.cts",
61
+ "default": "./dist/index.cjs"
62
+ },
63
+ "default": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }
68
64
  },
69
65
  "./generator": {
70
- "import": "./dist/generator.js",
71
- "require": "./dist/generator.cjs",
72
- "default": "./dist/generator.js"
73
- },
74
- "./config": {
75
- "import": "./dist/config.js",
76
- "require": "./dist/config.cjs",
77
- "default": "./dist/config.js"
78
- },
79
- ".": {
80
- "import": "./dist/index.js",
81
- "require": "./dist/index.cjs",
82
- "default": "./dist/index.js"
66
+ "import": {
67
+ "types": "./dist/generator.d.ts",
68
+ "default": "./dist/generator.js"
69
+ },
70
+ "require": {
71
+ "types": "./dist/generator.d.cts",
72
+ "default": "./dist/generator.cjs"
73
+ },
74
+ "default": {
75
+ "types": "./dist/generator.d.ts",
76
+ "default": "./dist/generator.js"
77
+ }
83
78
  },
84
79
  "./package.json": "./package.json"
85
80
  },
81
+ "types": "./dist/index.d.ts",
86
82
  "files": ["dist/**/*"],
87
83
  "keywords": [
88
84
  "stryke",
@@ -98,13 +94,17 @@
98
94
  "dependencies": {
99
95
  "@prisma/generator-helper": "^6.5.0",
100
96
  "@prisma/internals": "^6.5.0",
97
+ "@prisma/prisma-schema-wasm": "^6.6.0-41.9061db3b0058e3d3731c6fe68a1b77061bed4861",
98
+ "esbuild": "^0.25.0",
99
+ "ts-morph": "^25.0.1"
100
+ },
101
+ "devDependencies": {
102
+ "@types/pluralize": "^0.0.33",
101
103
  "pluralize": "^8.0.0",
102
104
  "prisma-trpc-shield-generator": "^0.1.0",
103
105
  "prisma-zod-generator": "^0.8.13",
104
- "ts-morph": "^25.0.1",
106
+ "tsup": "^8.3.5",
105
107
  "zod": "^3.24.2"
106
108
  },
107
- "devDependencies": { "tsup": "^8.3.5" },
108
- "publishConfig": { "access": "public" },
109
- "sideEffects": false
109
+ "publishConfig": { "access": "public" }
110
110
  }
@@ -1,19 +0,0 @@
1
- import {
2
- generate
3
- } from "./chunk-GQ7ABBSV.js";
4
- import {
5
- __name
6
- } from "./chunk-SHUYVCID.js";
7
-
8
- // src/index.ts
9
- import { generatorHandler } from "@prisma/generator-helper";
10
- generatorHandler({
11
- onManifest: /* @__PURE__ */ __name(() => ({
12
- defaultOutput: "./generated",
13
- prettyName: "Prisma tRPC Generator",
14
- requiresGenerators: [
15
- "prisma-client-js"
16
- ]
17
- }), "onManifest"),
18
- onGenerate: generate
19
- });