@tsed/cli-plugin-prisma 7.0.0-rc.2 → 7.0.0-rc.4
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.
|
@@ -15,16 +15,19 @@ export class CliPrisma {
|
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
init() {
|
|
18
|
-
return this.run("init", ["--db", "--
|
|
18
|
+
return this.run("init", ["--db", "--generator-provider", "prisma-client-js"]);
|
|
19
19
|
}
|
|
20
20
|
async patchPrismaSchema() {
|
|
21
21
|
const schemaPath = join(this.projectPackageJson.dir, "prisma", "schema.prisma");
|
|
22
22
|
if (this.cliFs.fileExistsSync(schemaPath)) {
|
|
23
23
|
let content = await this.cliFs.readFile(schemaPath, "utf8");
|
|
24
24
|
if (!content.includes("generator tsed")) {
|
|
25
|
-
content += "\ngenerator tsed {\n" + ' provider = "tsed-prisma"\n' + "}\n";
|
|
26
25
|
content +=
|
|
27
|
-
"\
|
|
26
|
+
"\ngenerator tsed {\n" +
|
|
27
|
+
' provider = "tsed-prisma"\n' +
|
|
28
|
+
' output = "../src/generated"\n' +
|
|
29
|
+
"}\n" +
|
|
30
|
+
"\nmodel User {\n" +
|
|
28
31
|
" id Int @default(autoincrement()) @id\n" +
|
|
29
32
|
" email String @unique\n" +
|
|
30
33
|
" name String?\n" +
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/cli-plugin-prisma",
|
|
3
3
|
"description": "Ts.ED CLI plugin. Add Prisma project initialisation support.",
|
|
4
|
-
"version": "7.0.0-rc.
|
|
4
|
+
"version": "7.0.0-rc.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/esm/index.js",
|
|
7
7
|
"source": "./src/index.ts",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"tslib": "2.7.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@tsed/cli": "7.0.0-rc.
|
|
30
|
-
"@tsed/cli-core": "7.0.0-rc.
|
|
31
|
-
"@tsed/typescript": "7.0.0-rc.
|
|
29
|
+
"@tsed/cli": "7.0.0-rc.4",
|
|
30
|
+
"@tsed/cli-core": "7.0.0-rc.4",
|
|
31
|
+
"@tsed/typescript": "7.0.0-rc.4",
|
|
32
32
|
"cross-env": "7.0.3",
|
|
33
33
|
"typescript": "5.6.2",
|
|
34
34
|
"vitest": "3.2.4"
|
|
@@ -27,7 +27,7 @@ describe("Prisma: Init cmd", () => {
|
|
|
27
27
|
devDependencies: {}
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
-
$on("npx prisma init --db --
|
|
30
|
+
$on("npx prisma init --db --generator-provider prisma-client-js", () => {
|
|
31
31
|
inject(CliFs).writeFileSync("project-name/prisma/schema.prisma", ``, {encoding: "utf8"});
|
|
32
32
|
});
|
|
33
33
|
|
|
@@ -101,7 +101,7 @@ describe("Prisma: Init cmd", () => {
|
|
|
101
101
|
"yarn add -D --ignore-engines @types/node @types/multer tslib nodemon @types/cors @types/express @types/compression @types/cookie-parser @types/method-override",
|
|
102
102
|
"yarn add --ignore-engines @tsed/logger @tsed/logger-std @tsed/engines @tsed/barrels ajv cross-env @swc/core @swc/cli @swc/helpers @swc-node/register typescript body-parser cors compression cookie-parser express method-override @tsed/prisma @prisma/client",
|
|
103
103
|
"yarn add -D --ignore-engines @types/node @types/multer tslib nodemon @types/cors @types/express @types/compression @types/cookie-parser @types/method-override prisma",
|
|
104
|
-
"npx prisma init --db --
|
|
104
|
+
"npx prisma init --db --generator-provider prisma-client-js",
|
|
105
105
|
]
|
|
106
106
|
`);
|
|
107
107
|
|
|
@@ -111,6 +111,7 @@ describe("Prisma: Init cmd", () => {
|
|
|
111
111
|
"
|
|
112
112
|
generator tsed {
|
|
113
113
|
provider = "tsed-prisma"
|
|
114
|
+
output = "../src/generated"
|
|
114
115
|
}
|
|
115
116
|
|
|
116
117
|
model User {
|