@tsed/cli-plugin-prisma 3.20.12 → 3.20.13

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.
@@ -9,11 +9,11 @@ const PrismaInitHook_1 = require("./hooks/PrismaInitHook");
9
9
  let CliPluginPrismaModule = class CliPluginPrismaModule {
10
10
  };
11
11
  tslib_1.__decorate([
12
- di_1.Inject(),
12
+ (0, di_1.Inject)(),
13
13
  tslib_1.__metadata("design:type", cli_core_1.ProjectPackageJson)
14
14
  ], CliPluginPrismaModule.prototype, "packageJson", void 0);
15
15
  CliPluginPrismaModule = tslib_1.__decorate([
16
- cli_core_1.Module({
16
+ (0, cli_core_1.Module)({
17
17
  imports: [PrismaInitHook_1.PrismaInitHook, PrismaCmd_1.PrismaCmd]
18
18
  })
19
19
  ], CliPluginPrismaModule);
@@ -1 +1 @@
1
- {"version":3,"file":"CliPluginPrismaModule.js","sourceRoot":"","sources":["../src/CliPluginPrismaModule.ts"],"names":[],"mappings":";;;;AAAA,6CAA0D;AAC1D,iCAAgC;AAChC,oDAA+C;AAC/C,2DAAsD;AAKtD,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;CAGjC,CAAA;AADC;IADC,WAAM,EAAE;sCACI,6BAAkB;0DAAC;AAFrB,qBAAqB;IAHjC,iBAAM,CAAC;QACN,OAAO,EAAE,CAAC,+BAAc,EAAE,qBAAS,CAAC;KACrC,CAAC;GACW,qBAAqB,CAGjC;AAHY,sDAAqB","sourcesContent":["import {Module, ProjectPackageJson} from \"@tsed/cli-core\";\nimport {Inject} from \"@tsed/di\";\nimport {PrismaCmd} from \"./commands/PrismaCmd\";\nimport {PrismaInitHook} from \"./hooks/PrismaInitHook\";\n\n@Module({\n imports: [PrismaInitHook, PrismaCmd]\n})\nexport class CliPluginPrismaModule {\n @Inject()\n packageJson: ProjectPackageJson;\n}\n"]}
1
+ {"version":3,"file":"CliPluginPrismaModule.js","sourceRoot":"","sources":["../src/CliPluginPrismaModule.ts"],"names":[],"mappings":";;;;AAAA,6CAA0D;AAC1D,iCAAgC;AAChC,oDAA+C;AAC/C,2DAAsD;AAKtD,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;CAGjC,CAAA;AADC;IADC,IAAA,WAAM,GAAE;sCACI,6BAAkB;0DAAC;AAFrB,qBAAqB;IAHjC,IAAA,iBAAM,EAAC;QACN,OAAO,EAAE,CAAC,+BAAc,EAAE,qBAAS,CAAC;KACrC,CAAC;GACW,qBAAqB,CAGjC;AAHY,sDAAqB","sourcesContent":["import {Module, ProjectPackageJson} from \"@tsed/cli-core\";\nimport {Inject} from \"@tsed/di\";\nimport {PrismaCmd} from \"./commands/PrismaCmd\";\nimport {PrismaInitHook} from \"./hooks/PrismaInitHook\";\n\n@Module({\n imports: [PrismaInitHook, PrismaCmd]\n})\nexport class CliPluginPrismaModule {\n @Inject()\n packageJson: ProjectPackageJson;\n}\n"]}
@@ -15,11 +15,11 @@ let PrismaCmd = class PrismaCmd {
15
15
  }
16
16
  };
17
17
  tslib_1.__decorate([
18
- cli_core_1.Inject(),
18
+ (0, cli_core_1.Inject)(),
19
19
  tslib_1.__metadata("design:type", CliPrisma_1.CliPrisma)
20
20
  ], PrismaCmd.prototype, "cli", void 0);
21
21
  PrismaCmd = tslib_1.__decorate([
22
- cli_core_1.Command({
22
+ (0, cli_core_1.Command)({
23
23
  name: "prisma",
24
24
  description: "Run a prisma command",
25
25
  args: {
@@ -1 +1 @@
1
- {"version":3,"file":"PrismaCmd.js","sourceRoot":"","sources":["../../src/commands/PrismaCmd.ts"],"names":[],"mappings":";;;;AAAA,6CAAmF;AACnF,qDAAgD;AAmBhD,IAAa,SAAS,GAAtB,MAAa,SAAS;IAIpB,KAAK,CAAC,KAAK,CAAC,GAAkB;QAC5B,OAAO;YACL;gBACE,KAAK,EAAE,kBAAkB,GAAG,CAAC,OAAO,EAAE;gBACtC,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC;aACnD;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AAVC;IADC,iBAAM,EAAE;sCACJ,qBAAS;sCAAC;AAFJ,SAAS;IAbrB,kBAAO,CAAC;QACP,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,sBAAsB;QACnC,IAAI,EAAE;YACJ,OAAO,EAAE;gBACP,WAAW,EAAE,oBAAoB;gBACjC,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,IAAI;aACf;SACF;QACD,OAAO,EAAE,EAAE;QACX,kBAAkB,EAAE,IAAI;KACzB,CAAC;GACW,SAAS,CAYrB;AAZY,8BAAS","sourcesContent":["import {Command, CliDefaultOptions, CommandProvider, Inject} from \"@tsed/cli-core\";\nimport {CliPrisma} from \"../services/CliPrisma\";\n\nexport interface PrismaContext extends CliDefaultOptions {\n command: string;\n}\n\n@Command({\n name: \"prisma\",\n description: \"Run a prisma command\",\n args: {\n command: {\n description: \"The prisma command\",\n type: String,\n required: true\n }\n },\n options: {},\n allowUnknownOption: true\n})\nexport class PrismaCmd implements CommandProvider {\n @Inject()\n cli: CliPrisma;\n\n async $exec(ctx: PrismaContext) {\n return [\n {\n title: `Run Prisma CLI ${ctx.command}`,\n task: () => this.cli.run(ctx.command, ctx.rawArgs)\n }\n ];\n }\n}\n"]}
1
+ {"version":3,"file":"PrismaCmd.js","sourceRoot":"","sources":["../../src/commands/PrismaCmd.ts"],"names":[],"mappings":";;;;AAAA,6CAAmF;AACnF,qDAAgD;AAmBhD,IAAa,SAAS,GAAtB,MAAa,SAAS;IAIpB,KAAK,CAAC,KAAK,CAAC,GAAkB;QAC5B,OAAO;YACL;gBACE,KAAK,EAAE,kBAAkB,GAAG,CAAC,OAAO,EAAE;gBACtC,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC;aACnD;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AAVC;IADC,IAAA,iBAAM,GAAE;sCACJ,qBAAS;sCAAC;AAFJ,SAAS;IAbrB,IAAA,kBAAO,EAAC;QACP,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,sBAAsB;QACnC,IAAI,EAAE;YACJ,OAAO,EAAE;gBACP,WAAW,EAAE,oBAAoB;gBACjC,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,IAAI;aACf;SACF;QACD,OAAO,EAAE,EAAE;QACX,kBAAkB,EAAE,IAAI;KACzB,CAAC;GACW,SAAS,CAYrB;AAZY,8BAAS","sourcesContent":["import {Command, CliDefaultOptions, CommandProvider, Inject} from \"@tsed/cli-core\";\nimport {CliPrisma} from \"../services/CliPrisma\";\n\nexport interface PrismaContext extends CliDefaultOptions {\n command: string;\n}\n\n@Command({\n name: \"prisma\",\n description: \"Run a prisma command\",\n args: {\n command: {\n description: \"The prisma command\",\n type: String,\n required: true\n }\n },\n options: {},\n allowUnknownOption: true\n})\nexport class PrismaCmd implements CommandProvider {\n @Inject()\n cli: CliPrisma;\n\n async $exec(ctx: PrismaContext) {\n return [\n {\n title: `Run Prisma CLI ${ctx.command}`,\n task: () => this.cli.run(ctx.command, ctx.rawArgs)\n }\n ];\n }\n}\n"]}
@@ -38,25 +38,25 @@ let PrismaInitHook = class PrismaInitHook {
38
38
  }
39
39
  };
40
40
  tslib_1.__decorate([
41
- cli_core_1.Inject(),
41
+ (0, cli_core_1.Inject)(),
42
42
  tslib_1.__metadata("design:type", CliPrisma_1.CliPrisma)
43
43
  ], PrismaInitHook.prototype, "cliPrisma", void 0);
44
44
  tslib_1.__decorate([
45
- cli_core_1.Inject(),
45
+ (0, cli_core_1.Inject)(),
46
46
  tslib_1.__metadata("design:type", cli_core_1.CliService)
47
47
  ], PrismaInitHook.prototype, "cliService", void 0);
48
48
  tslib_1.__decorate([
49
- cli_core_1.Inject(),
49
+ (0, cli_core_1.Inject)(),
50
50
  tslib_1.__metadata("design:type", cli_core_1.ProjectPackageJson)
51
51
  ], PrismaInitHook.prototype, "packageJson", void 0);
52
52
  tslib_1.__decorate([
53
- cli_core_1.OnExec("init"),
53
+ (0, cli_core_1.OnExec)("init"),
54
54
  tslib_1.__metadata("design:type", Function),
55
55
  tslib_1.__metadata("design:paramtypes", [Object]),
56
56
  tslib_1.__metadata("design:returntype", Promise)
57
57
  ], PrismaInitHook.prototype, "onExec", null);
58
58
  PrismaInitHook = tslib_1.__decorate([
59
- di_1.Injectable()
59
+ (0, di_1.Injectable)()
60
60
  ], PrismaInitHook);
61
61
  exports.PrismaInitHook = PrismaInitHook;
62
62
  //# sourceMappingURL=PrismaInitHook.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PrismaInitHook.js","sourceRoot":"","sources":["../../src/hooks/PrismaInitHook.ts"],"names":[],"mappings":";;;;AACA,6CAA8E;AAC9E,iCAAoC;AACpC,qDAAgD;AAGhD,IAAa,cAAc,GAA3B,MAAa,cAAc;IAWzB,KAAK,CAAC,MAAM,CAAC,GAAmB;QAC9B,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAE7B,OAAO;YACL;gBACE,KAAK,EAAE,wBAAwB;gBAC/B,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;aAClC;YACD;gBACE,KAAK,EAAE,0CAA0C;gBACjD,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE;aAC/C;SACF,CAAC;IACJ,CAAC;IAED,UAAU;QACR,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC;YAC1B,gBAAgB,EAAE,oCAAoC;YACtD,iBAAiB,EAAE,qBAAqB;SACzC,CAAC,CAAC;IACL,CAAC;IAED,eAAe,CAAC,GAAmB;QACjC,IAAI,CAAC,WAAW,CAAC,eAAe,CAC9B;YACE,cAAc,EAAE,QAAQ;YACxB,gBAAgB,EAAE,QAAQ;SAC3B,EACD,GAAG,CACJ,CAAC;IACJ,CAAC;IAED,kBAAkB,CAAC,GAAmB;QACpC,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC/C,CAAC;CACF,CAAA;AA9CC;IADC,iBAAM,EAAE;sCACY,qBAAS;iDAAC;AAG/B;IADC,iBAAM,EAAE;sCACa,qBAAU;kDAAC;AAGjC;IADC,iBAAM,EAAE;sCACc,6BAAkB;mDAAC;AAG1C;IADC,iBAAM,CAAC,MAAM,CAAC;;;;4CAgBd;AA1BU,cAAc;IAD1B,eAAU,EAAE;GACA,cAAc,CAgD1B;AAhDY,wCAAc","sourcesContent":["import {InitCmdContext} from \"@tsed/cli\";\nimport {CliService, Inject, OnExec, ProjectPackageJson} from \"@tsed/cli-core\";\nimport {Injectable} from \"@tsed/di\";\nimport {CliPrisma} from \"../services/CliPrisma\";\n\n@Injectable()\nexport class PrismaInitHook {\n @Inject()\n protected cliPrisma: CliPrisma;\n\n @Inject()\n protected cliService: CliService;\n\n @Inject()\n protected packageJson: ProjectPackageJson;\n\n @OnExec(\"init\")\n async onExec(ctx: InitCmdContext) {\n this.addScripts();\n this.addDependencies(ctx);\n this.addDevDependencies(ctx);\n\n return [\n {\n title: \"Generate Prisma schema\",\n task: () => this.cliPrisma.init()\n },\n {\n title: \"Add Ts.ED configuration to Prisma schema\",\n task: () => this.cliPrisma.patchPrismaSchema()\n }\n ];\n }\n\n addScripts() {\n this.packageJson.addScripts({\n \"prisma:migrate\": \"npx prisma migrate dev --name init\",\n \"prisma:generate\": \"npx prisma generate\"\n });\n }\n\n addDependencies(ctx: InitCmdContext) {\n this.packageJson.addDependencies(\n {\n \"@tsed/prisma\": \"latest\",\n \"@prisma/client\": \"latest\"\n },\n ctx\n );\n }\n\n addDevDependencies(ctx: InitCmdContext) {\n this.packageJson.addDevDependencies({}, ctx);\n }\n}\n"]}
1
+ {"version":3,"file":"PrismaInitHook.js","sourceRoot":"","sources":["../../src/hooks/PrismaInitHook.ts"],"names":[],"mappings":";;;;AACA,6CAA8E;AAC9E,iCAAoC;AACpC,qDAAgD;AAGhD,IAAa,cAAc,GAA3B,MAAa,cAAc;IAWzB,KAAK,CAAC,MAAM,CAAC,GAAmB;QAC9B,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAE7B,OAAO;YACL;gBACE,KAAK,EAAE,wBAAwB;gBAC/B,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;aAClC;YACD;gBACE,KAAK,EAAE,0CAA0C;gBACjD,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE;aAC/C;SACF,CAAC;IACJ,CAAC;IAED,UAAU;QACR,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC;YAC1B,gBAAgB,EAAE,oCAAoC;YACtD,iBAAiB,EAAE,qBAAqB;SACzC,CAAC,CAAC;IACL,CAAC;IAED,eAAe,CAAC,GAAmB;QACjC,IAAI,CAAC,WAAW,CAAC,eAAe,CAC9B;YACE,cAAc,EAAE,QAAQ;YACxB,gBAAgB,EAAE,QAAQ;SAC3B,EACD,GAAG,CACJ,CAAC;IACJ,CAAC;IAED,kBAAkB,CAAC,GAAmB;QACpC,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC/C,CAAC;CACF,CAAA;AA9CC;IADC,IAAA,iBAAM,GAAE;sCACY,qBAAS;iDAAC;AAG/B;IADC,IAAA,iBAAM,GAAE;sCACa,qBAAU;kDAAC;AAGjC;IADC,IAAA,iBAAM,GAAE;sCACc,6BAAkB;mDAAC;AAG1C;IADC,IAAA,iBAAM,EAAC,MAAM,CAAC;;;;4CAgBd;AA1BU,cAAc;IAD1B,IAAA,eAAU,GAAE;GACA,cAAc,CAgD1B;AAhDY,wCAAc","sourcesContent":["import {InitCmdContext} from \"@tsed/cli\";\nimport {CliService, Inject, OnExec, ProjectPackageJson} from \"@tsed/cli-core\";\nimport {Injectable} from \"@tsed/di\";\nimport {CliPrisma} from \"../services/CliPrisma\";\n\n@Injectable()\nexport class PrismaInitHook {\n @Inject()\n protected cliPrisma: CliPrisma;\n\n @Inject()\n protected cliService: CliService;\n\n @Inject()\n protected packageJson: ProjectPackageJson;\n\n @OnExec(\"init\")\n async onExec(ctx: InitCmdContext) {\n this.addScripts();\n this.addDependencies(ctx);\n this.addDevDependencies(ctx);\n\n return [\n {\n title: \"Generate Prisma schema\",\n task: () => this.cliPrisma.init()\n },\n {\n title: \"Add Ts.ED configuration to Prisma schema\",\n task: () => this.cliPrisma.patchPrismaSchema()\n }\n ];\n }\n\n addScripts() {\n this.packageJson.addScripts({\n \"prisma:migrate\": \"npx prisma migrate dev --name init\",\n \"prisma:generate\": \"npx prisma generate\"\n });\n }\n\n addDependencies(ctx: InitCmdContext) {\n this.packageJson.addDependencies(\n {\n \"@tsed/prisma\": \"latest\",\n \"@prisma/client\": \"latest\"\n },\n ctx\n );\n }\n\n addDevDependencies(ctx: InitCmdContext) {\n this.packageJson.addDevDependencies({}, ctx);\n }\n}\n"]}
@@ -26,19 +26,19 @@ let CliPrisma = class CliPrisma {
26
26
  }
27
27
  };
28
28
  tslib_1.__decorate([
29
- cli_core_1.Inject(),
29
+ (0, cli_core_1.Inject)(),
30
30
  tslib_1.__metadata("design:type", cli_core_1.CliExeca)
31
31
  ], CliPrisma.prototype, "cliExeca", void 0);
32
32
  tslib_1.__decorate([
33
- cli_core_1.Inject(),
33
+ (0, cli_core_1.Inject)(),
34
34
  tslib_1.__metadata("design:type", cli_core_1.CliFs)
35
35
  ], CliPrisma.prototype, "cliFs", void 0);
36
36
  tslib_1.__decorate([
37
- cli_core_1.Inject(),
37
+ (0, cli_core_1.Inject)(),
38
38
  tslib_1.__metadata("design:type", cli_core_1.ProjectPackageJson)
39
39
  ], CliPrisma.prototype, "projectPackageJson", void 0);
40
40
  CliPrisma = tslib_1.__decorate([
41
- di_1.Injectable()
41
+ (0, di_1.Injectable)()
42
42
  ], CliPrisma);
43
43
  exports.CliPrisma = CliPrisma;
44
44
  //# sourceMappingURL=CliPrisma.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CliPrisma.js","sourceRoot":"","sources":["../../src/services/CliPrisma.ts"],"names":[],"mappings":";;;;AAAA,6CAA2E;AAC3E,iCAAoC;AAGpC,IAAa,SAAS,GAAtB,MAAa,SAAS;IAUpB,GAAG,CAAC,OAAe,EAAE,OAAiB,EAAE,EAAE,UAAe,EAAE;QACzD,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,EAAE;YAC5D,GAAG,OAAO;YACV,GAAG,EAAE,IAAI,CAAC,kBAAkB,CAAC,GAAG;SACjC,CAAC,CAAC;IACL,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC;QAE3F,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE;YACjC,IAAI,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;YAE5D,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE;gBACvC,OAAO,IAAI,sBAAsB,GAAG,8BAA8B,GAAG,KAAK,CAAC;gBAE3E,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,EAAE,OAAO,EAAE,EAAC,QAAQ,EAAE,MAAM,EAAC,CAAC,CAAC;aACtE;SACF;IACH,CAAC;CACF,CAAA;AAhCC;IADC,iBAAM,EAAE;sCACW,mBAAQ;2CAAC;AAG7B;IADC,iBAAM,EAAE;sCACQ,gBAAK;wCAAC;AAGvB;IADC,iBAAM,EAAE;sCACqB,6BAAkB;qDAAC;AARtC,SAAS;IADrB,eAAU,EAAE;GACA,SAAS,CAkCrB;AAlCY,8BAAS","sourcesContent":["import {CliExeca, CliFs, Inject, ProjectPackageJson} from \"@tsed/cli-core\";\nimport {Injectable} from \"@tsed/di\";\n\n@Injectable()\nexport class CliPrisma {\n @Inject()\n protected cliExeca: CliExeca;\n\n @Inject()\n protected cliFs: CliFs;\n\n @Inject()\n protected projectPackageJson: ProjectPackageJson;\n\n run(command: string, args: string[] = [], options: any = {}) {\n return this.cliExeca.run(\"npx\", [\"prisma\", command, ...args], {\n ...options,\n cwd: this.projectPackageJson.dir\n });\n }\n\n init() {\n return this.run(\"init\");\n }\n\n async patchPrismaSchema() {\n const schemaPath = this.cliFs.join(this.projectPackageJson.dir, \"prisma\", \"schema.prisma\");\n\n if (this.cliFs.exists(schemaPath)) {\n let content = await this.cliFs.readFile(schemaPath, \"utf8\");\n\n if (!content.includes(\"generator tsed\")) {\n content += \"\\ngenerator tsed {\\n\" + ' provider = \"tsed-prisma\"\\n' + \"}\\n\";\n\n return this.cliFs.writeFile(schemaPath, content, {encoding: \"utf8\"});\n }\n }\n }\n}\n"]}
1
+ {"version":3,"file":"CliPrisma.js","sourceRoot":"","sources":["../../src/services/CliPrisma.ts"],"names":[],"mappings":";;;;AAAA,6CAA2E;AAC3E,iCAAoC;AAGpC,IAAa,SAAS,GAAtB,MAAa,SAAS;IAUpB,GAAG,CAAC,OAAe,EAAE,OAAiB,EAAE,EAAE,UAAe,EAAE;QACzD,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,EAAE;YAC5D,GAAG,OAAO;YACV,GAAG,EAAE,IAAI,CAAC,kBAAkB,CAAC,GAAG;SACjC,CAAC,CAAC;IACL,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC;QAE3F,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE;YACjC,IAAI,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;YAE5D,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE;gBACvC,OAAO,IAAI,sBAAsB,GAAG,8BAA8B,GAAG,KAAK,CAAC;gBAE3E,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,EAAE,OAAO,EAAE,EAAC,QAAQ,EAAE,MAAM,EAAC,CAAC,CAAC;aACtE;SACF;IACH,CAAC;CACF,CAAA;AAhCC;IADC,IAAA,iBAAM,GAAE;sCACW,mBAAQ;2CAAC;AAG7B;IADC,IAAA,iBAAM,GAAE;sCACQ,gBAAK;wCAAC;AAGvB;IADC,IAAA,iBAAM,GAAE;sCACqB,6BAAkB;qDAAC;AARtC,SAAS;IADrB,IAAA,eAAU,GAAE;GACA,SAAS,CAkCrB;AAlCY,8BAAS","sourcesContent":["import {CliExeca, CliFs, Inject, ProjectPackageJson} from \"@tsed/cli-core\";\nimport {Injectable} from \"@tsed/di\";\n\n@Injectable()\nexport class CliPrisma {\n @Inject()\n protected cliExeca: CliExeca;\n\n @Inject()\n protected cliFs: CliFs;\n\n @Inject()\n protected projectPackageJson: ProjectPackageJson;\n\n run(command: string, args: string[] = [], options: any = {}) {\n return this.cliExeca.run(\"npx\", [\"prisma\", command, ...args], {\n ...options,\n cwd: this.projectPackageJson.dir\n });\n }\n\n init() {\n return this.run(\"init\");\n }\n\n async patchPrismaSchema() {\n const schemaPath = this.cliFs.join(this.projectPackageJson.dir, \"prisma\", \"schema.prisma\");\n\n if (this.cliFs.exists(schemaPath)) {\n let content = await this.cliFs.readFile(schemaPath, \"utf8\");\n\n if (!content.includes(\"generator tsed\")) {\n content += \"\\ngenerator tsed {\\n\" + ' provider = \"tsed-prisma\"\\n' + \"}\\n\";\n\n return this.cliFs.writeFile(schemaPath, content, {encoding: \"utf8\"});\n }\n }\n }\n}\n"]}
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TEMPLATE_DIR = void 0;
4
4
  const path_1 = require("path");
5
- exports.TEMPLATE_DIR = path_1.resolve(__dirname, "..", "..", "templates");
5
+ exports.TEMPLATE_DIR = (0, path_1.resolve)(__dirname, "..", "..", "templates");
6
6
  //# sourceMappingURL=templateDir.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"templateDir.js","sourceRoot":"","sources":["../../src/utils/templateDir.ts"],"names":[],"mappings":";;;AAAA,+BAA6B;AAEhB,QAAA,YAAY,GAAG,cAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import {resolve} from \"path\";\n\nexport const TEMPLATE_DIR = resolve(__dirname, \"..\", \"..\", \"templates\");\n"]}
1
+ {"version":3,"file":"templateDir.js","sourceRoot":"","sources":["../../src/utils/templateDir.ts"],"names":[],"mappings":";;;AAAA,+BAA6B;AAEhB,QAAA,YAAY,GAAG,IAAA,cAAO,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import {resolve} from \"path\";\n\nexport const TEMPLATE_DIR = resolve(__dirname, \"..\", \"..\", \"templates\");\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/cli-plugin-prisma",
3
- "version": "3.20.12",
3
+ "version": "3.20.13",
4
4
  "main": "./lib/index.js",
5
5
  "typings": "./lib/index.d.ts",
6
6
  "description": "Ts.ED CLI plugin. Add Prisma project initialisation support.",
@@ -9,8 +9,8 @@
9
9
  "tslib": "2.3.1"
10
10
  },
11
11
  "devDependencies": {
12
- "@tsed/cli": "3.20.12",
13
- "@tsed/cli-core": "3.20.12"
12
+ "@tsed/cli": "3.20.13",
13
+ "@tsed/cli-core": "3.20.13"
14
14
  },
15
15
  "scripts": {
16
16
  "build": "tsc --build tsconfig.compile.json",