@tsed/cli-plugin-prisma 5.4.3 → 6.0.0-alpha.10
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/lib/esm/CliPluginPrismaModule.js +0 -2
- package/lib/esm/commands/PrismaCmd.js +0 -2
- package/lib/esm/hooks/PrismaInitHook.js +0 -5
- package/lib/esm/index.js +0 -1
- package/lib/esm/services/CliPrisma.js +0 -4
- package/lib/esm/utils/templateDir.js +2 -5
- package/lib/types/commands/PrismaCmd.d.ts +2 -2
- package/lib/types/hooks/PrismaInitHook.d.ts +2 -2
- package/lib/types/index.d.ts +4 -4
- package/package.json +22 -20
- package/scripts/templateDir.esm.js +2 -1
- package/vitest.config.mts +21 -0
- package/.eslintignore +0 -13
- package/.eslintrc.js +0 -1
- package/jest.config.js +0 -14
- package/lib/cjs/CliPluginPrismaModule.js +0 -22
- package/lib/cjs/CliPluginPrismaModule.js.map +0 -1
- package/lib/cjs/commands/PrismaCmd.js +0 -38
- package/lib/cjs/commands/PrismaCmd.js.map +0 -1
- package/lib/cjs/hooks/PrismaInitHook.js +0 -84
- package/lib/cjs/hooks/PrismaInitHook.js.map +0 -1
- package/lib/cjs/index.js +0 -9
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/package.json +0 -3
- package/lib/cjs/services/CliPrisma.js +0 -53
- package/lib/cjs/services/CliPrisma.js.map +0 -1
- package/lib/cjs/utils/templateDir.js +0 -6
- package/lib/cjs/utils/templateDir.js.map +0 -1
- package/lib/esm/CliPluginPrismaModule.js.map +0 -1
- package/lib/esm/commands/PrismaCmd.js.map +0 -1
- package/lib/esm/hooks/PrismaInitHook.js.map +0 -1
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/package.json +0 -3
- package/lib/esm/services/CliPrisma.js.map +0 -1
- package/lib/esm/utils/templateDir.js.map +0 -1
- package/lib/tsconfig.esm.tsbuildinfo +0 -1
- package/lib/tsconfig.tsbuildinfo +0 -1
- package/tsconfig.esm.json +0 -39
|
@@ -4,7 +4,6 @@ import { Inject } from "@tsed/di";
|
|
|
4
4
|
import { PrismaCmd } from "./commands/PrismaCmd.js";
|
|
5
5
|
import { PrismaInitHook } from "./hooks/PrismaInitHook.js";
|
|
6
6
|
let CliPluginPrismaModule = class CliPluginPrismaModule {
|
|
7
|
-
packageJson;
|
|
8
7
|
};
|
|
9
8
|
__decorate([
|
|
10
9
|
Inject(),
|
|
@@ -16,4 +15,3 @@ CliPluginPrismaModule = __decorate([
|
|
|
16
15
|
})
|
|
17
16
|
], CliPluginPrismaModule);
|
|
18
17
|
export { CliPluginPrismaModule };
|
|
19
|
-
//# sourceMappingURL=CliPluginPrismaModule.js.map
|
|
@@ -2,7 +2,6 @@ import { __decorate, __metadata } from "tslib";
|
|
|
2
2
|
import { Command, Inject } from "@tsed/cli-core";
|
|
3
3
|
import { CliPrisma } from "../services/CliPrisma.js";
|
|
4
4
|
let PrismaCmd = class PrismaCmd {
|
|
5
|
-
cli;
|
|
6
5
|
$exec(ctx) {
|
|
7
6
|
return [
|
|
8
7
|
{
|
|
@@ -32,4 +31,3 @@ PrismaCmd = __decorate([
|
|
|
32
31
|
})
|
|
33
32
|
], PrismaCmd);
|
|
34
33
|
export { PrismaCmd };
|
|
35
|
-
//# sourceMappingURL=PrismaCmd.js.map
|
|
@@ -3,10 +3,6 @@ import { CliService, Inject, OnExec, PackageManagersModule, ProjectPackageJson }
|
|
|
3
3
|
import { Injectable } from "@tsed/di";
|
|
4
4
|
import { CliPrisma } from "../services/CliPrisma.js";
|
|
5
5
|
let PrismaInitHook = class PrismaInitHook {
|
|
6
|
-
cliPrisma;
|
|
7
|
-
cliService;
|
|
8
|
-
packageJson;
|
|
9
|
-
packageManagers;
|
|
10
6
|
onExec(ctx) {
|
|
11
7
|
this.addScripts();
|
|
12
8
|
this.addDependencies(ctx);
|
|
@@ -78,4 +74,3 @@ PrismaInitHook = __decorate([
|
|
|
78
74
|
Injectable()
|
|
79
75
|
], PrismaInitHook);
|
|
80
76
|
export { PrismaInitHook };
|
|
81
|
-
//# sourceMappingURL=PrismaInitHook.js.map
|
package/lib/esm/index.js
CHANGED
|
@@ -2,9 +2,6 @@ import { __decorate, __metadata } from "tslib";
|
|
|
2
2
|
import { CliExeca, CliFs, Inject, ProjectPackageJson } from "@tsed/cli-core";
|
|
3
3
|
import { Injectable } from "@tsed/di";
|
|
4
4
|
let CliPrisma = class CliPrisma {
|
|
5
|
-
cliExeca;
|
|
6
|
-
cliFs;
|
|
7
|
-
projectPackageJson;
|
|
8
5
|
run(command, args = [], options = {}) {
|
|
9
6
|
return this.cliExeca.run("npx", ["prisma", command, ...args], {
|
|
10
7
|
...options,
|
|
@@ -47,4 +44,3 @@ CliPrisma = __decorate([
|
|
|
47
44
|
Injectable()
|
|
48
45
|
], CliPrisma);
|
|
49
46
|
export { CliPrisma };
|
|
50
|
-
//# sourceMappingURL=CliPrisma.js.map
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
import {getTemplateDirectory} from "@tsed/cli-core";
|
|
2
|
-
|
|
3
|
-
import {fileURLToPath} from "node:url";
|
|
4
|
-
|
|
5
|
-
export const TEMPLATE_DIR = getTemplateDirectory(path.dirname(fileURLToPath(import.meta.url)));
|
|
1
|
+
import { getTemplateDirectory } from "@tsed/cli-core";
|
|
2
|
+
export const TEMPLATE_DIR = getTemplateDirectory(import.meta.dirname);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CliDefaultOptions, CommandProvider } from "@tsed/cli-core";
|
|
2
|
-
import { CliPrisma } from "../services/CliPrisma";
|
|
1
|
+
import { type CliDefaultOptions, type CommandProvider } from "@tsed/cli-core";
|
|
2
|
+
import { CliPrisma } from "../services/CliPrisma.js";
|
|
3
3
|
export interface PrismaContext extends CliDefaultOptions {
|
|
4
4
|
command: string;
|
|
5
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { InitCmdContext } from "@tsed/cli";
|
|
1
|
+
import type { InitCmdContext } from "@tsed/cli";
|
|
2
2
|
import { CliService, PackageManagersModule, ProjectPackageJson } from "@tsed/cli-core";
|
|
3
|
-
import { CliPrisma } from "../services/CliPrisma";
|
|
3
|
+
import { CliPrisma } from "../services/CliPrisma.js";
|
|
4
4
|
export declare class PrismaInitHook {
|
|
5
5
|
protected cliPrisma: CliPrisma;
|
|
6
6
|
protected cliService: CliService;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CliPluginPrismaModule } from "./CliPluginPrismaModule";
|
|
2
|
-
export * from "./hooks/PrismaInitHook";
|
|
3
|
-
export * from "./services/CliPrisma";
|
|
4
|
-
export * from "./utils/templateDir";
|
|
1
|
+
import { CliPluginPrismaModule } from "./CliPluginPrismaModule.js";
|
|
2
|
+
export * from "./hooks/PrismaInitHook.js";
|
|
3
|
+
export * from "./services/CliPrisma.js";
|
|
4
|
+
export * from "./utils/templateDir.js";
|
|
5
5
|
export default CliPluginPrismaModule;
|
package/package.json
CHANGED
|
@@ -1,37 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/cli-plugin-prisma",
|
|
3
|
-
"version": "5.4.3",
|
|
4
3
|
"description": "Ts.ED CLI plugin. Add Prisma project initialisation support.",
|
|
4
|
+
"version": "6.0.0-alpha.10",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./lib/esm/index.js",
|
|
5
7
|
"source": "./src/index.ts",
|
|
6
|
-
"main": "./lib/cjs/index.js",
|
|
7
8
|
"module": "./lib/esm/index.js",
|
|
8
9
|
"typings": "./lib/types/index.d.ts",
|
|
9
10
|
"exports": {
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./lib/types/index.d.ts",
|
|
13
|
+
"import": "./lib/esm/index.js",
|
|
14
|
+
"default": "./lib/esm/index.js"
|
|
15
|
+
}
|
|
14
16
|
},
|
|
15
17
|
"scripts": {
|
|
16
18
|
"build": "yarn build:ts",
|
|
17
|
-
"build:ts": "tsc --build tsconfig.json
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"test": "cross-env NODE_ENV=test yarn jest --max-workers=2 --passWithNoTests && jest-coverage-thresholds-bumper"
|
|
19
|
+
"build:ts": "tsc --build tsconfig.json",
|
|
20
|
+
"test": "vitest run",
|
|
21
|
+
"test:ci": "vitest run --coverage.thresholds.autoUpdate=true"
|
|
21
22
|
},
|
|
22
23
|
"dependencies": {
|
|
23
|
-
"change-case": "4.
|
|
24
|
-
"tslib": "2.
|
|
24
|
+
"change-case": "5.4.4",
|
|
25
|
+
"tslib": "2.7.0"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
|
-
"@tsed/cli": "
|
|
28
|
-
"@tsed/cli-core": "
|
|
29
|
-
"@tsed/
|
|
30
|
-
"@tsed/jest-config": "5.4.3",
|
|
31
|
-
"@tsed/typescript": "5.4.3",
|
|
28
|
+
"@tsed/cli": "6.0.0-alpha.10",
|
|
29
|
+
"@tsed/cli-core": "6.0.0-alpha.10",
|
|
30
|
+
"@tsed/typescript": "6.0.0-alpha.10",
|
|
32
31
|
"cross-env": "7.0.3",
|
|
33
|
-
"
|
|
34
|
-
"
|
|
32
|
+
"typescript": "5.6.2",
|
|
33
|
+
"vitest": "2.1.1"
|
|
35
34
|
},
|
|
36
35
|
"peerDependencies": {},
|
|
37
36
|
"repository": "https://github.com/tsedio/tsed-cli",
|
|
@@ -40,5 +39,8 @@
|
|
|
40
39
|
},
|
|
41
40
|
"homepage": "https://github.com/tsedio/tsed-cli/tree/master/packages/cli-plugin-prisma",
|
|
42
41
|
"author": "Romain Lenzotti",
|
|
43
|
-
"license": "MIT"
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"tag": "alpha"
|
|
45
|
+
}
|
|
44
46
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {getTemplateDirectory} from "@tsed/cli-core";
|
|
2
1
|
import path from "node:path";
|
|
3
2
|
import {fileURLToPath} from "node:url";
|
|
4
3
|
|
|
4
|
+
import {getTemplateDirectory} from "@tsed/cli-core";
|
|
5
|
+
|
|
5
6
|
export const TEMPLATE_DIR = getTemplateDirectory(path.dirname(fileURLToPath(import.meta.url)));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import {presets} from "@tsed/vitest/presets";
|
|
3
|
+
import {defineConfig} from "vitest/config";
|
|
4
|
+
|
|
5
|
+
export default defineConfig(
|
|
6
|
+
{
|
|
7
|
+
...presets,
|
|
8
|
+
test: {
|
|
9
|
+
...presets.test,
|
|
10
|
+
coverage: {
|
|
11
|
+
...presets.test.coverage,
|
|
12
|
+
thresholds: {
|
|
13
|
+
statements: 0,
|
|
14
|
+
branches: 0,
|
|
15
|
+
functions: 0,
|
|
16
|
+
lines: 0
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
);
|
package/.eslintignore
DELETED
package/.eslintrc.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require("@tsed/eslint/node.js");
|
package/jest.config.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// For a detailed explanation regarding each configuration property, visit:
|
|
2
|
-
// https://jestjs.io/docs/en/configuration.html
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
...require("@tsed/jest-config"),
|
|
6
|
-
coverageThreshold: {
|
|
7
|
-
global: {
|
|
8
|
-
statements: 84.44,
|
|
9
|
-
branches: 50,
|
|
10
|
-
functions: 33.33,
|
|
11
|
-
lines: 84.44
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CliPluginPrismaModule = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const cli_core_1 = require("@tsed/cli-core");
|
|
6
|
-
const di_1 = require("@tsed/di");
|
|
7
|
-
const PrismaCmd_1 = require("./commands/PrismaCmd");
|
|
8
|
-
const PrismaInitHook_1 = require("./hooks/PrismaInitHook");
|
|
9
|
-
let CliPluginPrismaModule = class CliPluginPrismaModule {
|
|
10
|
-
packageJson;
|
|
11
|
-
};
|
|
12
|
-
tslib_1.__decorate([
|
|
13
|
-
(0, di_1.Inject)(),
|
|
14
|
-
tslib_1.__metadata("design:type", cli_core_1.ProjectPackageJson)
|
|
15
|
-
], CliPluginPrismaModule.prototype, "packageJson", void 0);
|
|
16
|
-
CliPluginPrismaModule = tslib_1.__decorate([
|
|
17
|
-
(0, cli_core_1.Module)({
|
|
18
|
-
imports: [PrismaInitHook_1.PrismaInitHook, PrismaCmd_1.PrismaCmd]
|
|
19
|
-
})
|
|
20
|
-
], CliPluginPrismaModule);
|
|
21
|
-
exports.CliPluginPrismaModule = CliPluginPrismaModule;
|
|
22
|
-
//# sourceMappingURL=CliPluginPrismaModule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CliPluginPrismaModule.js","sourceRoot":"","sources":["../../src/CliPluginPrismaModule.ts"],"names":[],"mappings":";;;;AAAA,6CAA0D;AAC1D,iCAAgC;AAChC,oDAA+C;AAC/C,2DAAsD;AAK/C,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAEhC,WAAW,CAAqB;CACjC,CAAA;AAFC;IAAC,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"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PrismaCmd = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const cli_core_1 = require("@tsed/cli-core");
|
|
6
|
-
const CliPrisma_1 = require("../services/CliPrisma");
|
|
7
|
-
let PrismaCmd = class PrismaCmd {
|
|
8
|
-
cli;
|
|
9
|
-
$exec(ctx) {
|
|
10
|
-
return [
|
|
11
|
-
{
|
|
12
|
-
title: `Run Prisma CLI ${ctx.command}`,
|
|
13
|
-
task: () => this.cli.run(ctx.command, ctx.rawArgs)
|
|
14
|
-
}
|
|
15
|
-
];
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
tslib_1.__decorate([
|
|
19
|
-
(0, cli_core_1.Inject)(),
|
|
20
|
-
tslib_1.__metadata("design:type", CliPrisma_1.CliPrisma)
|
|
21
|
-
], PrismaCmd.prototype, "cli", void 0);
|
|
22
|
-
PrismaCmd = tslib_1.__decorate([
|
|
23
|
-
(0, cli_core_1.Command)({
|
|
24
|
-
name: "prisma",
|
|
25
|
-
description: "Run a prisma command",
|
|
26
|
-
args: {
|
|
27
|
-
command: {
|
|
28
|
-
description: "The prisma command",
|
|
29
|
-
type: String,
|
|
30
|
-
required: true
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
options: {},
|
|
34
|
-
allowUnknownOption: true
|
|
35
|
-
})
|
|
36
|
-
], PrismaCmd);
|
|
37
|
-
exports.PrismaCmd = PrismaCmd;
|
|
38
|
-
//# sourceMappingURL=PrismaCmd.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrismaCmd.js","sourceRoot":"","sources":["../../../src/commands/PrismaCmd.ts"],"names":[],"mappings":";;;;AAAA,6CAAmF;AACnF,qDAAgD;AAmBzC,IAAM,SAAS,GAAf,MAAM,SAAS;IAEpB,GAAG,CAAY;IAEf,KAAK,CAAC,GAAkB;QACtB,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;AAXC;IAAC,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"}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PrismaInitHook = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const cli_core_1 = require("@tsed/cli-core");
|
|
6
|
-
const di_1 = require("@tsed/di");
|
|
7
|
-
const CliPrisma_1 = require("../services/CliPrisma");
|
|
8
|
-
let PrismaInitHook = class PrismaInitHook {
|
|
9
|
-
cliPrisma;
|
|
10
|
-
cliService;
|
|
11
|
-
packageJson;
|
|
12
|
-
packageManagers;
|
|
13
|
-
onExec(ctx) {
|
|
14
|
-
this.addScripts();
|
|
15
|
-
this.addDependencies(ctx);
|
|
16
|
-
this.addDevDependencies(ctx);
|
|
17
|
-
return [
|
|
18
|
-
{
|
|
19
|
-
title: "Generate Prisma schema",
|
|
20
|
-
task: () => this.cliPrisma.init()
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
title: "Add Ts.ED configuration to Prisma schema",
|
|
24
|
-
task: () => this.cliPrisma.patchPrismaSchema()
|
|
25
|
-
}
|
|
26
|
-
];
|
|
27
|
-
}
|
|
28
|
-
addScripts() {
|
|
29
|
-
this.packageJson.addScripts({
|
|
30
|
-
"prisma:migrate": "npx prisma migrate dev --name init",
|
|
31
|
-
"prisma:generate": "npx prisma generate"
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
addDependencies(ctx) {
|
|
35
|
-
this.packageJson.addDependencies({
|
|
36
|
-
"@tsed/prisma": "latest",
|
|
37
|
-
"@prisma/client": "latest"
|
|
38
|
-
}, ctx);
|
|
39
|
-
}
|
|
40
|
-
addDevDependencies(ctx) {
|
|
41
|
-
this.packageJson.addDevDependencies({
|
|
42
|
-
prisma: "latest"
|
|
43
|
-
}, ctx);
|
|
44
|
-
}
|
|
45
|
-
$onFinish() {
|
|
46
|
-
return new Promise((resolve) => {
|
|
47
|
-
this.packageManagers.runScript("prisma:generate").subscribe({
|
|
48
|
-
complete() {
|
|
49
|
-
resolve([]);
|
|
50
|
-
},
|
|
51
|
-
error: () => {
|
|
52
|
-
resolve([]);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
tslib_1.__decorate([
|
|
59
|
-
(0, cli_core_1.Inject)(),
|
|
60
|
-
tslib_1.__metadata("design:type", CliPrisma_1.CliPrisma)
|
|
61
|
-
], PrismaInitHook.prototype, "cliPrisma", void 0);
|
|
62
|
-
tslib_1.__decorate([
|
|
63
|
-
(0, cli_core_1.Inject)(),
|
|
64
|
-
tslib_1.__metadata("design:type", cli_core_1.CliService)
|
|
65
|
-
], PrismaInitHook.prototype, "cliService", void 0);
|
|
66
|
-
tslib_1.__decorate([
|
|
67
|
-
(0, cli_core_1.Inject)(),
|
|
68
|
-
tslib_1.__metadata("design:type", cli_core_1.ProjectPackageJson)
|
|
69
|
-
], PrismaInitHook.prototype, "packageJson", void 0);
|
|
70
|
-
tslib_1.__decorate([
|
|
71
|
-
(0, cli_core_1.Inject)(),
|
|
72
|
-
tslib_1.__metadata("design:type", cli_core_1.PackageManagersModule)
|
|
73
|
-
], PrismaInitHook.prototype, "packageManagers", void 0);
|
|
74
|
-
tslib_1.__decorate([
|
|
75
|
-
(0, cli_core_1.OnExec)("init"),
|
|
76
|
-
tslib_1.__metadata("design:type", Function),
|
|
77
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
78
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
79
|
-
], PrismaInitHook.prototype, "onExec", null);
|
|
80
|
-
PrismaInitHook = tslib_1.__decorate([
|
|
81
|
-
(0, di_1.Injectable)()
|
|
82
|
-
], PrismaInitHook);
|
|
83
|
-
exports.PrismaInitHook = PrismaInitHook;
|
|
84
|
-
//# sourceMappingURL=PrismaInitHook.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrismaInitHook.js","sourceRoot":"","sources":["../../../src/hooks/PrismaInitHook.ts"],"names":[],"mappings":";;;;AACA,6CAAqG;AACrG,iCAAoC;AACpC,qDAAgD;AAGzC,IAAM,cAAc,GAApB,MAAM,cAAc;IAEf,SAAS,CAAY;IAGrB,UAAU,CAAa;IAGvB,WAAW,CAAqB;IAGhC,eAAe,CAAwB;IAGjD,MAAM,CAAC,GAAmB;QACxB,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,CACjC;YACE,MAAM,EAAE,QAAQ;SACjB,EACD,GAAG,CACJ,CAAC;IACJ,CAAC;IAED,SAAS;QACP,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC7B,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,SAAS,CAAC;gBAC1D,QAAQ;oBACN,OAAO,CAAC,EAAE,CAAC,CAAC;gBACd,CAAC;gBACD,KAAK,EAAE,GAAG,EAAE;oBACV,OAAO,CAAC,EAAE,CAAC,CAAC;gBACd,CAAC;aACF,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AApEC;IAAC,IAAA,iBAAM,GAAE;sCACY,qBAAS;iDAAC;AAE/B;IAAC,IAAA,iBAAM,GAAE;sCACa,qBAAU;kDAAC;AAEjC;IAAC,IAAA,iBAAM,GAAE;sCACc,6BAAkB;mDAAC;AAE1C;IAAC,IAAA,iBAAM,GAAE;sCACkB,gCAAqB;uDAAC;AAEjD;IAAC,IAAA,iBAAM,EAAC,MAAM,CAAC;;;;4CAgBd;AA7BU,cAAc;IAD1B,IAAA,eAAU,GAAE;GACA,cAAc,CAqE1B;AArEY,wCAAc"}
|
package/lib/cjs/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const CliPluginPrismaModule_1 = require("./CliPluginPrismaModule");
|
|
5
|
-
tslib_1.__exportStar(require("./hooks/PrismaInitHook"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./services/CliPrisma"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./utils/templateDir"), exports);
|
|
8
|
-
exports.default = CliPluginPrismaModule_1.CliPluginPrismaModule;
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,mEAA8D;AAE9D,iEAAuC;AACvC,+DAAqC;AACrC,8DAAoC;AAEpC,kBAAe,6CAAqB,CAAC"}
|
package/lib/cjs/package.json
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CliPrisma = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const cli_core_1 = require("@tsed/cli-core");
|
|
6
|
-
const di_1 = require("@tsed/di");
|
|
7
|
-
let CliPrisma = class CliPrisma {
|
|
8
|
-
cliExeca;
|
|
9
|
-
cliFs;
|
|
10
|
-
projectPackageJson;
|
|
11
|
-
run(command, args = [], options = {}) {
|
|
12
|
-
return this.cliExeca.run("npx", ["prisma", command, ...args], {
|
|
13
|
-
...options,
|
|
14
|
-
cwd: this.projectPackageJson.dir
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
init() {
|
|
18
|
-
return this.run("init");
|
|
19
|
-
}
|
|
20
|
-
async patchPrismaSchema() {
|
|
21
|
-
const schemaPath = this.cliFs.join(this.projectPackageJson.dir, "prisma", "schema.prisma");
|
|
22
|
-
if (this.cliFs.exists(schemaPath)) {
|
|
23
|
-
let content = await this.cliFs.readFile(schemaPath, "utf8");
|
|
24
|
-
if (!content.includes("generator tsed")) {
|
|
25
|
-
content += "\ngenerator tsed {\n" + ' provider = "tsed-prisma"\n' + "}\n";
|
|
26
|
-
content +=
|
|
27
|
-
"\nmodel User {\n" +
|
|
28
|
-
" id Int @default(autoincrement()) @id\n" +
|
|
29
|
-
" email String @unique\n" +
|
|
30
|
-
" name String?\n" +
|
|
31
|
-
"}\n";
|
|
32
|
-
return this.cliFs.writeFile(schemaPath, content, { encoding: "utf8" });
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
tslib_1.__decorate([
|
|
38
|
-
(0, cli_core_1.Inject)(),
|
|
39
|
-
tslib_1.__metadata("design:type", cli_core_1.CliExeca)
|
|
40
|
-
], CliPrisma.prototype, "cliExeca", void 0);
|
|
41
|
-
tslib_1.__decorate([
|
|
42
|
-
(0, cli_core_1.Inject)(),
|
|
43
|
-
tslib_1.__metadata("design:type", cli_core_1.CliFs)
|
|
44
|
-
], CliPrisma.prototype, "cliFs", void 0);
|
|
45
|
-
tslib_1.__decorate([
|
|
46
|
-
(0, cli_core_1.Inject)(),
|
|
47
|
-
tslib_1.__metadata("design:type", cli_core_1.ProjectPackageJson)
|
|
48
|
-
], CliPrisma.prototype, "projectPackageJson", void 0);
|
|
49
|
-
CliPrisma = tslib_1.__decorate([
|
|
50
|
-
(0, di_1.Injectable)()
|
|
51
|
-
], CliPrisma);
|
|
52
|
-
exports.CliPrisma = CliPrisma;
|
|
53
|
-
//# sourceMappingURL=CliPrisma.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CliPrisma.js","sourceRoot":"","sources":["../../../src/services/CliPrisma.ts"],"names":[],"mappings":";;;;AAAA,6CAA2E;AAC3E,iCAAoC;AAG7B,IAAM,SAAS,GAAf,MAAM,SAAS;IAEV,QAAQ,CAAW;IAGnB,KAAK,CAAQ;IAGb,kBAAkB,CAAqB;IAEjD,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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IR = void 0;
|
|
4
|
-
const cli_core_1 = require("@tsed/cli-core");
|
|
5
|
-
exports.TEMPLATE_DIR = (0, cli_core_1.getTemplateDirectory)(__dirname);
|
|
6
|
-
//# sourceMappingURL=templateDir.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"templateDir.js","sourceRoot":"","sources":["../../../src/utils/templateDir.ts"],"names":[],"mappings":";;;AAAA,6CAAoD;AAEvC,QAAA,YAAY,GAAG,IAAA,+BAAoB,EAAC,SAAS,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CliPluginPrismaModule.js","sourceRoot":"","sources":["../../src/CliPluginPrismaModule.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,MAAM,EAAE,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAC,cAAc,EAAC,MAAM,wBAAwB,CAAC;AAK/C,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAEhC,WAAW,CAAqB;CACjC,CAAA;AAFC;IAAC,MAAM,EAAE;8BACI,kBAAkB;0DAAC;AAFrB,qBAAqB;IAHjC,MAAM,CAAC;QACN,OAAO,EAAE,CAAC,cAAc,EAAE,SAAS,CAAC;KACrC,CAAC;GACW,qBAAqB,CAGjC;SAHY,qBAAqB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrismaCmd.js","sourceRoot":"","sources":["../../../src/commands/PrismaCmd.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,OAAO,EAAsC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAmBzC,IAAM,SAAS,GAAf,MAAM,SAAS;IAEpB,GAAG,CAAY;IAEf,KAAK,CAAC,GAAkB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AAU,EAAE;GACA,cAAc,CAqE1B;SArEY,cAAc"}
|
package/lib/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAE9D,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AAEpC,eAAe,qBAAqB,CAAC"}
|
package/lib/esm/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CliPrisma.js","sourceRoot":"","sources":["../../../src/services/CliPrisma.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAG7B,IAAM,SAAS,GAAf,MAAM,SAAS;IAEV,QAAQ,CAAW;IAGnB,KAAK,CAAQ;IAGb,kBAAkB,CAAqB;IAEjD,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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