Skip to content

Commit

Permalink
move generation to current pwd node_modules
Browse files Browse the repository at this point in the history
  • Loading branch information
foyarash committed Jan 21, 2025
1 parent 75ed97b commit cdc1469
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/generator-prisma/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,18 @@ import { generatorHandler } from "@prisma/generator-helper";
import { parseEnvValue } from "@prisma/internals";
import path from "path";
import fs from "fs/promises";
import { execSync } from "node:child_process";
// @ts-expect-error
import { transformDMMF } from "prisma-json-schema-generator/dist/generator/transformDMMF";
import { insertDmmfData } from "./dmmf";

generatorHandler({
onManifest: () => {
const nodeModulesRoot = execSync("npm root").toString("utf8");

return {
defaultOutput: path.resolve(
path.join(
require.resolve("@premieroctet/next-admin"),
"..",
"..",
"node_modules",
".next-admin"
)
path.join(nodeModulesRoot.trim(), ".next-admin")
),
prettyName: "Next Admin JSON Schema Generator",
};
Expand Down

0 comments on commit cdc1469

Please sign in to comment.