@tsed/cli-plugin-prisma 6.6.2 → 7.0.0-alpha.1
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 +37 -10
- package/lib/esm/commands/PrismaCmd.js +16 -20
- package/lib/esm/hooks/PrismaInitHook.js +9 -44
- package/lib/esm/index.js +1 -1
- package/lib/esm/services/CliPrisma.js +13 -23
- package/lib/types/CliPluginPrismaModule.d.ts +7 -0
- package/lib/types/commands/PrismaCmd.d.ts +2 -2
- package/lib/types/hooks/PrismaInitHook.d.ts +4 -14
- package/lib/types/index.d.ts +1 -1
- package/package.json +8 -5
- package/tests/init.integration.spec.ts +164 -0
- package/lib/esm/utils/templateDir.js +0 -2
- package/lib/types/utils/templateDir.d.ts +0 -1
- package/scripts/templateDir.esm.js +0 -6
|
@@ -1,12 +1,39 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import {
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { inject, OnAdd, ProjectPackageJson } from "@tsed/cli-core";
|
|
3
|
+
import { injectable } from "@tsed/di";
|
|
3
4
|
import { PrismaCmd } from "./commands/PrismaCmd.js";
|
|
4
5
|
import { PrismaInitHook } from "./hooks/PrismaInitHook.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
export class CliPluginPrismaModule {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.packageJson = inject(ProjectPackageJson);
|
|
9
|
+
}
|
|
10
|
+
onAdd(ctx) {
|
|
11
|
+
this.addScripts();
|
|
12
|
+
this.addDependencies(ctx);
|
|
13
|
+
this.addDevDependencies(ctx);
|
|
14
|
+
}
|
|
15
|
+
addScripts() {
|
|
16
|
+
this.packageJson.addScripts({
|
|
17
|
+
"prisma:migrate": "npx prisma migrate dev --name init",
|
|
18
|
+
"prisma:generate": "npx prisma generate"
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
addDependencies(ctx) {
|
|
22
|
+
this.packageJson.addDependencies({
|
|
23
|
+
"@tsed/prisma": "latest",
|
|
24
|
+
"@prisma/client": "latest"
|
|
25
|
+
}, ctx);
|
|
26
|
+
}
|
|
27
|
+
addDevDependencies(ctx) {
|
|
28
|
+
this.packageJson.addDevDependencies({
|
|
29
|
+
prisma: "latest"
|
|
30
|
+
}, ctx);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
__decorate([
|
|
34
|
+
OnAdd("@tsed/cli-plugin-prisma"),
|
|
35
|
+
__metadata("design:type", Function),
|
|
36
|
+
__metadata("design:paramtypes", [Object]),
|
|
37
|
+
__metadata("design:returntype", void 0)
|
|
38
|
+
], CliPluginPrismaModule.prototype, "onAdd", null);
|
|
39
|
+
injectable(CliPluginPrismaModule).imports([PrismaInitHook, PrismaCmd]);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Command, inject } from "@tsed/cli-core";
|
|
1
|
+
import { Command, command, inject } from "@tsed/cli-core";
|
|
3
2
|
import { CliPrisma } from "../services/CliPrisma.js";
|
|
4
|
-
|
|
3
|
+
export class PrismaCmd {
|
|
5
4
|
constructor() {
|
|
6
5
|
this.cli = inject(CliPrisma);
|
|
7
6
|
}
|
|
@@ -13,20 +12,17 @@ let PrismaCmd = class PrismaCmd {
|
|
|
13
12
|
}
|
|
14
13
|
];
|
|
15
14
|
}
|
|
16
|
-
}
|
|
17
|
-
PrismaCmd
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
})
|
|
31
|
-
], PrismaCmd);
|
|
32
|
-
export { PrismaCmd };
|
|
15
|
+
}
|
|
16
|
+
command(PrismaCmd, {
|
|
17
|
+
name: "prisma",
|
|
18
|
+
description: "Run a prisma command",
|
|
19
|
+
args: {
|
|
20
|
+
command: {
|
|
21
|
+
description: "The prisma command",
|
|
22
|
+
type: String,
|
|
23
|
+
required: true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
options: {},
|
|
27
|
+
allowUnknownOption: true
|
|
28
|
+
});
|
|
@@ -1,47 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Injectable } from "@tsed/di";
|
|
1
|
+
import { inject, PackageManagersModule, ProjectPackageJson } from "@tsed/cli-core";
|
|
2
|
+
import { injectable } from "@tsed/di";
|
|
4
3
|
import { CliPrisma } from "../services/CliPrisma.js";
|
|
5
|
-
|
|
4
|
+
export class PrismaInitHook {
|
|
6
5
|
constructor() {
|
|
7
6
|
this.cliPrisma = inject(CliPrisma);
|
|
8
7
|
this.packageJson = inject(ProjectPackageJson);
|
|
9
8
|
this.packageManagers = inject(PackageManagersModule);
|
|
10
9
|
}
|
|
11
|
-
|
|
12
|
-
this.addScripts();
|
|
13
|
-
this.addDependencies(ctx);
|
|
14
|
-
this.addDevDependencies(ctx);
|
|
15
|
-
}
|
|
16
|
-
onExec() {
|
|
10
|
+
$alterInitSubTasks(tasks, data) {
|
|
17
11
|
return [
|
|
12
|
+
...tasks,
|
|
18
13
|
{
|
|
19
14
|
title: "Generate Prisma schema",
|
|
15
|
+
enabled: () => !!data.prisma,
|
|
20
16
|
task: () => this.cliPrisma.init()
|
|
21
17
|
},
|
|
22
18
|
{
|
|
23
19
|
title: "Add Ts.ED configuration to Prisma schema",
|
|
20
|
+
enabled: () => !!data.prisma,
|
|
24
21
|
task: () => this.cliPrisma.patchPrismaSchema()
|
|
25
22
|
}
|
|
26
23
|
];
|
|
27
24
|
}
|
|
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
25
|
$onFinish() {
|
|
46
26
|
return new Promise((resolve) => {
|
|
47
27
|
this.packageManagers.runScript("prisma:generate").subscribe({
|
|
@@ -54,20 +34,5 @@ let PrismaInitHook = class PrismaInitHook {
|
|
|
54
34
|
});
|
|
55
35
|
});
|
|
56
36
|
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
OnAdd("@tsed/cli-plugin-prisma"),
|
|
60
|
-
__metadata("design:type", Function),
|
|
61
|
-
__metadata("design:paramtypes", [Object]),
|
|
62
|
-
__metadata("design:returntype", void 0)
|
|
63
|
-
], PrismaInitHook.prototype, "onAdd", null);
|
|
64
|
-
__decorate([
|
|
65
|
-
OnExec("init"),
|
|
66
|
-
__metadata("design:type", Function),
|
|
67
|
-
__metadata("design:paramtypes", []),
|
|
68
|
-
__metadata("design:returntype", void 0)
|
|
69
|
-
], PrismaInitHook.prototype, "onExec", null);
|
|
70
|
-
PrismaInitHook = __decorate([
|
|
71
|
-
Injectable()
|
|
72
|
-
], PrismaInitHook);
|
|
73
|
-
export { PrismaInitHook };
|
|
37
|
+
}
|
|
38
|
+
injectable(PrismaInitHook);
|
package/lib/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CliPluginPrismaModule } from "./CliPluginPrismaModule.js";
|
|
2
|
+
export * from "./commands/PrismaCmd.js";
|
|
2
3
|
export * from "./hooks/PrismaInitHook.js";
|
|
3
4
|
export * from "./services/CliPrisma.js";
|
|
4
|
-
export * from "./utils/templateDir.js";
|
|
5
5
|
export default CliPluginPrismaModule;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CliExeca, CliFs,
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { CliExeca, CliFs, ProjectPackageJson } from "@tsed/cli-core";
|
|
3
|
+
import { inject, injectable } from "@tsed/di";
|
|
4
|
+
export class CliPrisma {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.cliExeca = inject(CliExeca);
|
|
7
|
+
this.cliFs = inject(CliFs);
|
|
8
|
+
this.projectPackageJson = inject(ProjectPackageJson);
|
|
9
|
+
}
|
|
5
10
|
run(command, args = [], options = {}) {
|
|
6
11
|
return this.cliExeca.run("npx", ["prisma", command, ...args], {
|
|
7
12
|
...options,
|
|
@@ -12,8 +17,8 @@ let CliPrisma = class CliPrisma {
|
|
|
12
17
|
return this.run("init");
|
|
13
18
|
}
|
|
14
19
|
async patchPrismaSchema() {
|
|
15
|
-
const schemaPath =
|
|
16
|
-
if (this.cliFs.
|
|
20
|
+
const schemaPath = join(this.projectPackageJson.dir, "prisma", "schema.prisma");
|
|
21
|
+
if (this.cliFs.fileExistsSync(schemaPath)) {
|
|
17
22
|
let content = await this.cliFs.readFile(schemaPath, "utf8");
|
|
18
23
|
if (!content.includes("generator tsed")) {
|
|
19
24
|
content += "\ngenerator tsed {\n" + ' provider = "tsed-prisma"\n' + "}\n";
|
|
@@ -27,20 +32,5 @@ let CliPrisma = class CliPrisma {
|
|
|
27
32
|
}
|
|
28
33
|
}
|
|
29
34
|
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
Inject(),
|
|
33
|
-
__metadata("design:type", CliExeca)
|
|
34
|
-
], CliPrisma.prototype, "cliExeca", void 0);
|
|
35
|
-
__decorate([
|
|
36
|
-
Inject(),
|
|
37
|
-
__metadata("design:type", CliFs)
|
|
38
|
-
], CliPrisma.prototype, "cliFs", void 0);
|
|
39
|
-
__decorate([
|
|
40
|
-
Inject(),
|
|
41
|
-
__metadata("design:type", ProjectPackageJson)
|
|
42
|
-
], CliPrisma.prototype, "projectPackageJson", void 0);
|
|
43
|
-
CliPrisma = __decorate([
|
|
44
|
-
Injectable()
|
|
45
|
-
], CliPrisma);
|
|
46
|
-
export { CliPrisma };
|
|
35
|
+
}
|
|
36
|
+
injectable(CliPrisma);
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
import type { InitCmdContext } from "@tsed/cli";
|
|
2
|
+
import { ProjectPackageJson } from "@tsed/cli-core";
|
|
1
3
|
export declare class CliPluginPrismaModule {
|
|
4
|
+
protected packageJson: ProjectPackageJson;
|
|
5
|
+
onAdd(ctx: InitCmdContext): void;
|
|
6
|
+
addScripts(): void;
|
|
7
|
+
addDependencies(ctx: InitCmdContext): void;
|
|
8
|
+
addDevDependencies(ctx: InitCmdContext): void;
|
|
2
9
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type CommandData, type CommandProvider } from "@tsed/cli-core";
|
|
2
2
|
import { CliPrisma } from "../services/CliPrisma.js";
|
|
3
|
-
export interface PrismaContext extends
|
|
3
|
+
export interface PrismaContext extends CommandData {
|
|
4
4
|
command: string;
|
|
5
5
|
}
|
|
6
6
|
export declare class PrismaCmd implements CommandProvider {
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
import type { InitCmdContext } from "@tsed/cli";
|
|
2
|
-
import { PackageManagersModule, ProjectPackageJson } from "@tsed/cli-core";
|
|
1
|
+
import type { AlterInitSubTasks, InitCmdContext } from "@tsed/cli";
|
|
2
|
+
import { PackageManagersModule, ProjectPackageJson, type Task } from "@tsed/cli-core";
|
|
3
3
|
import { CliPrisma } from "../services/CliPrisma.js";
|
|
4
|
-
export declare class PrismaInitHook {
|
|
4
|
+
export declare class PrismaInitHook implements AlterInitSubTasks {
|
|
5
5
|
protected cliPrisma: CliPrisma;
|
|
6
6
|
protected packageJson: ProjectPackageJson;
|
|
7
7
|
protected packageManagers: PackageManagersModule;
|
|
8
|
-
|
|
9
|
-
onExec(): ({
|
|
10
|
-
title: string;
|
|
11
|
-
task: () => import("rxjs").Observable<any>;
|
|
12
|
-
} | {
|
|
13
|
-
title: string;
|
|
14
|
-
task: () => Promise<void>;
|
|
15
|
-
})[];
|
|
16
|
-
addScripts(): void;
|
|
17
|
-
addDependencies(ctx: InitCmdContext): void;
|
|
18
|
-
addDevDependencies(ctx: InitCmdContext): void;
|
|
8
|
+
$alterInitSubTasks(tasks: Task[], data: InitCmdContext): Task[] | Promise<Task[]>;
|
|
19
9
|
$onFinish(): Promise<unknown>;
|
|
20
10
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CliPluginPrismaModule } from "./CliPluginPrismaModule.js";
|
|
2
|
+
export * from "./commands/PrismaCmd.js";
|
|
2
3
|
export * from "./hooks/PrismaInitHook.js";
|
|
3
4
|
export * from "./services/CliPrisma.js";
|
|
4
|
-
export * from "./utils/templateDir.js";
|
|
5
5
|
export default CliPluginPrismaModule;
|
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": "
|
|
4
|
+
"version": "7.0.0-alpha.1",
|
|
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": "
|
|
30
|
-
"@tsed/cli-core": "
|
|
31
|
-
"@tsed/typescript": "
|
|
29
|
+
"@tsed/cli": "7.0.0-alpha.1",
|
|
30
|
+
"@tsed/cli-core": "7.0.0-alpha.1",
|
|
31
|
+
"@tsed/typescript": "7.0.0-alpha.1",
|
|
32
32
|
"cross-env": "7.0.3",
|
|
33
33
|
"typescript": "5.6.2",
|
|
34
34
|
"vitest": "3.2.4"
|
|
@@ -40,5 +40,8 @@
|
|
|
40
40
|
},
|
|
41
41
|
"homepage": "https://github.com/tsedio/tsed-cli/tree/master/packages/cli-plugin-prisma",
|
|
42
42
|
"author": "Romain Lenzotti",
|
|
43
|
-
"license": "MIT"
|
|
43
|
+
"license": "MIT",
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"tag": "alpha"
|
|
46
|
+
}
|
|
44
47
|
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import "../src/index.js";
|
|
2
|
+
|
|
3
|
+
import {ArchitectureConvention, FeatureType, InitCmd, PlatformType, ProjectConvention, TEMPLATE_DIR} from "@tsed/cli";
|
|
4
|
+
import {CliFs, PackageManager} from "@tsed/cli-core";
|
|
5
|
+
import {CliPlatformTest, FakeCliFs} from "@tsed/cli-testing";
|
|
6
|
+
import {FakeCliExeca} from "@tsed/cli-testing";
|
|
7
|
+
import {inject} from "@tsed/di";
|
|
8
|
+
import {$on} from "@tsed/hooks";
|
|
9
|
+
|
|
10
|
+
describe("Prisma: Init cmd", () => {
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
return CliPlatformTest.bootstrap({
|
|
13
|
+
templateDir: TEMPLATE_DIR,
|
|
14
|
+
commands: [InitCmd],
|
|
15
|
+
argv: ["init"]
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
afterEach(() => CliPlatformTest.reset());
|
|
19
|
+
|
|
20
|
+
it("should generate a project with the right options", async () => {
|
|
21
|
+
CliPlatformTest.setPackageJson({
|
|
22
|
+
name: "",
|
|
23
|
+
version: "1.0.0",
|
|
24
|
+
description: "",
|
|
25
|
+
scripts: {},
|
|
26
|
+
dependencies: {},
|
|
27
|
+
devDependencies: {}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
$on("npx prisma init", () => {
|
|
31
|
+
inject(CliFs).writeFileSync("project-name/prisma/schema.prisma", ``, {encoding: "utf8"});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
await CliPlatformTest.exec("init", {
|
|
35
|
+
verbose: false,
|
|
36
|
+
root: ".",
|
|
37
|
+
tsedVersion: "5.58.1",
|
|
38
|
+
rootDir: "./.tmp/init/default",
|
|
39
|
+
production: false,
|
|
40
|
+
rawArgs: [],
|
|
41
|
+
platform: PlatformType.EXPRESS,
|
|
42
|
+
architecture: ArchitectureConvention.DEFAULT,
|
|
43
|
+
convention: ProjectConvention.DEFAULT,
|
|
44
|
+
packageManager: PackageManager.YARN,
|
|
45
|
+
projectName: "default",
|
|
46
|
+
db: true,
|
|
47
|
+
typeorm: true,
|
|
48
|
+
mysql: true,
|
|
49
|
+
features: [FeatureType.DB, FeatureType.PRISMA],
|
|
50
|
+
srcDir: "src",
|
|
51
|
+
pnpm: false,
|
|
52
|
+
npm: false,
|
|
53
|
+
yarn: true,
|
|
54
|
+
express: true,
|
|
55
|
+
koa: false,
|
|
56
|
+
platformSymbol: "PlatformExpress",
|
|
57
|
+
route: "/rest",
|
|
58
|
+
prisma: true
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
expect(FakeCliFs.getKeys()).toMatchInlineSnapshot(`
|
|
62
|
+
[
|
|
63
|
+
"project-name",
|
|
64
|
+
"project-name/.barrels.json",
|
|
65
|
+
"project-name/.dockerignore",
|
|
66
|
+
"project-name/.gitignore",
|
|
67
|
+
"project-name/.swcrc",
|
|
68
|
+
"project-name/Dockerfile",
|
|
69
|
+
"project-name/README.md",
|
|
70
|
+
"project-name/docker-compose.yml",
|
|
71
|
+
"project-name/nodemon.json",
|
|
72
|
+
"project-name/package.json",
|
|
73
|
+
"project-name/prisma/schema.prisma",
|
|
74
|
+
"project-name/processes.config.cjs",
|
|
75
|
+
"project-name/src/Server.ts",
|
|
76
|
+
"project-name/src/config/config.ts",
|
|
77
|
+
"project-name/src/config/logger/index.ts",
|
|
78
|
+
"project-name/src/config/utils/index.ts",
|
|
79
|
+
"project-name/src/controllers/pages/IndexController.ts",
|
|
80
|
+
"project-name/src/controllers/rest/HelloWorldController.ts",
|
|
81
|
+
"project-name/src/index.ts",
|
|
82
|
+
"project-name/tsconfig.base.json",
|
|
83
|
+
"project-name/tsconfig.json",
|
|
84
|
+
"project-name/tsconfig.node.json",
|
|
85
|
+
]
|
|
86
|
+
`);
|
|
87
|
+
|
|
88
|
+
expect([...FakeCliExeca.entries.keys()]).toMatchInlineSnapshot(`
|
|
89
|
+
[
|
|
90
|
+
"yarn install",
|
|
91
|
+
"yarn add --ignore-engines @tsed/logger @tsed/engines @tsed/barrels ajv cross-env dotenv dotenv-expand dotenv-flow @swc/core @swc/cli @swc/helpers @swc-node/register typescript body-parser cors compression cookie-parser express method-override",
|
|
92
|
+
"yarn add -D --ignore-engines @types/node @types/multer tslib nodemon @types/cors @types/express @types/compression @types/cookie-parser @types/method-override",
|
|
93
|
+
"yarn add --ignore-engines @tsed/logger @tsed/engines @tsed/barrels ajv cross-env dotenv dotenv-expand dotenv-flow @swc/core @swc/cli @swc/helpers @swc-node/register typescript body-parser cors compression cookie-parser express method-override @tsed/prisma @prisma/client",
|
|
94
|
+
"yarn add -D --ignore-engines @types/node @types/multer tslib nodemon @types/cors @types/express @types/compression @types/cookie-parser @types/method-override prisma",
|
|
95
|
+
"npx prisma init",
|
|
96
|
+
"yarn run barrels",
|
|
97
|
+
]
|
|
98
|
+
`);
|
|
99
|
+
|
|
100
|
+
const content = FakeCliFs.files.get("project-name/prisma/schema.prisma")!;
|
|
101
|
+
|
|
102
|
+
expect(content).toMatchInlineSnapshot(`
|
|
103
|
+
"
|
|
104
|
+
generator tsed {
|
|
105
|
+
provider = "tsed-prisma"
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
model User {
|
|
109
|
+
id Int @default(autoincrement()) @id
|
|
110
|
+
email String @unique
|
|
111
|
+
name String?
|
|
112
|
+
}
|
|
113
|
+
"
|
|
114
|
+
`);
|
|
115
|
+
|
|
116
|
+
const pkgJson = FakeCliFs.files.get("project-name/package.json")!;
|
|
117
|
+
|
|
118
|
+
expect(pkgJson).toMatchInlineSnapshot(`
|
|
119
|
+
"{
|
|
120
|
+
"name": "default",
|
|
121
|
+
"version": "1.0.0",
|
|
122
|
+
"description": "",
|
|
123
|
+
"scripts": {
|
|
124
|
+
"build": "yarn run barrels && swc src --out-dir dist -s --strip-leading-paths",
|
|
125
|
+
"barrels": "barrels",
|
|
126
|
+
"start": "yarn run barrels && nodemon src/index.ts",
|
|
127
|
+
"start:prod": "cross-env NODE_ENV=production node --import @swc-node/register/esm-register src/index.js",
|
|
128
|
+
"prisma:migrate": "npx prisma migrate dev --name init",
|
|
129
|
+
"prisma:generate": "npx prisma generate"
|
|
130
|
+
},
|
|
131
|
+
"dependencies": {
|
|
132
|
+
"@tsed/ajv": "5.58.1",
|
|
133
|
+
"@tsed/core": "5.58.1",
|
|
134
|
+
"@tsed/di": "5.58.1",
|
|
135
|
+
"@tsed/exceptions": "5.58.1",
|
|
136
|
+
"@tsed/json-mapper": "5.58.1",
|
|
137
|
+
"@tsed/openspec": "5.58.1",
|
|
138
|
+
"@tsed/platform-cache": "5.58.1",
|
|
139
|
+
"@tsed/platform-exceptions": "5.58.1",
|
|
140
|
+
"@tsed/platform-express": "5.58.1",
|
|
141
|
+
"@tsed/platform-http": "5.58.1",
|
|
142
|
+
"@tsed/platform-log-request": "5.58.1",
|
|
143
|
+
"@tsed/platform-middlewares": "5.58.1",
|
|
144
|
+
"@tsed/platform-multer": "5.58.1",
|
|
145
|
+
"@tsed/platform-params": "5.58.1",
|
|
146
|
+
"@tsed/platform-response-filter": "5.58.1",
|
|
147
|
+
"@tsed/platform-views": "5.58.1",
|
|
148
|
+
"@tsed/schema": "5.58.1"
|
|
149
|
+
},
|
|
150
|
+
"devDependencies": {
|
|
151
|
+
"@tsed/cli-plugin-prisma": "1.0.0"
|
|
152
|
+
},
|
|
153
|
+
"tsed": {
|
|
154
|
+
"runtime": "node",
|
|
155
|
+
"packageManager": "yarn",
|
|
156
|
+
"architecture": "arc_default",
|
|
157
|
+
"convention": "conv_default",
|
|
158
|
+
"platform": "conv_default"
|
|
159
|
+
},
|
|
160
|
+
"type": "module"
|
|
161
|
+
}"
|
|
162
|
+
`);
|
|
163
|
+
});
|
|
164
|
+
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const TEMPLATE_DIR: string;
|