tspace-spear 1.2.7 → 1.2.9
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/README.md +299 -146
- package/dist/cli/generators/app/index.d.ts +1 -0
- package/dist/cli/generators/app/index.js +124 -0
- package/dist/cli/generators/app/index.js.map +1 -0
- package/dist/cli/generators/app/template.d.ts +1 -0
- package/dist/cli/{app.js → generators/app/template.js} +22 -8
- package/dist/cli/generators/app/template.js.map +1 -0
- package/dist/cli/generators/client/template.d.ts +1 -0
- package/dist/cli/generators/client/template.js +30 -0
- package/dist/cli/generators/client/template.js.map +1 -0
- package/dist/cli/generators/controller/index.d.ts +1 -0
- package/dist/cli/generators/controller/index.js +78 -0
- package/dist/cli/generators/controller/index.js.map +1 -0
- package/dist/cli/generators/controller/template.d.ts +1 -0
- package/dist/cli/generators/controller/template.js +106 -0
- package/dist/cli/generators/controller/template.js.map +1 -0
- package/dist/cli/generators/dto/index.d.ts +1 -0
- package/dist/cli/generators/dto/index.js +57 -0
- package/dist/cli/generators/dto/index.js.map +1 -0
- package/dist/cli/generators/dto/template.d.ts +1 -0
- package/dist/cli/generators/dto/template.js +32 -0
- package/dist/cli/generators/dto/template.js.map +1 -0
- package/dist/cli/generators/middleware/index.d.ts +1 -0
- package/dist/cli/generators/middleware/index.js +38 -0
- package/dist/cli/generators/middleware/index.js.map +1 -0
- package/dist/cli/generators/middleware/template.d.ts +1 -0
- package/dist/cli/generators/middleware/template.js +16 -0
- package/dist/cli/generators/middleware/template.js.map +1 -0
- package/dist/cli/generators/module/index.d.ts +1 -0
- package/dist/cli/generators/module/index.js +173 -0
- package/dist/cli/generators/module/index.js.map +1 -0
- package/dist/cli/generators/service/index.d.ts +1 -0
- package/dist/cli/generators/service/index.js +53 -0
- package/dist/cli/generators/service/index.js.map +1 -0
- package/dist/cli/generators/service/template.d.ts +1 -0
- package/dist/cli/generators/service/template.js +74 -0
- package/dist/cli/generators/service/template.js.map +1 -0
- package/dist/cli/generators/shared/index.d.ts +3 -0
- package/dist/cli/generators/shared/index.js +22 -0
- package/dist/cli/generators/shared/index.js.map +1 -0
- package/dist/cli/index.js +53 -96
- package/dist/cli/index.js.map +1 -1
- package/dist/lib/core/client/index.d.ts +13 -43
- package/dist/lib/core/client/index.js +47 -26
- package/dist/lib/core/client/index.js.map +1 -1
- package/dist/lib/core/{compiler → client}/types.d.ts +29 -0
- package/dist/lib/core/client/types.js.map +1 -0
- package/dist/lib/core/compiler/generator.d.ts +4 -6
- package/dist/lib/core/compiler/generator.js +186 -39
- package/dist/lib/core/compiler/generator.js.map +1 -1
- package/dist/lib/core/compiler/index.d.ts +2 -2
- package/dist/lib/core/compiler/index.js +2 -2
- package/dist/lib/core/compiler/index.js.map +1 -1
- package/dist/lib/core/compiler/pre-routes.d.ts +170 -34
- package/dist/lib/core/compiler/pre-routes.js +45 -25
- package/dist/lib/core/compiler/pre-routes.js.map +1 -1
- package/dist/lib/core/decorators/context.d.ts +78 -8
- package/dist/lib/core/decorators/context.js +84 -9
- package/dist/lib/core/decorators/context.js.map +1 -1
- package/dist/lib/core/decorators/statusCode.js +3 -1
- package/dist/lib/core/decorators/statusCode.js.map +1 -1
- package/dist/lib/core/package/index.d.ts +11 -0
- package/dist/lib/core/package/index.js +42 -0
- package/dist/lib/core/package/index.js.map +1 -0
- package/dist/lib/core/server/fast-router.d.ts +2 -2
- package/dist/lib/core/server/fast-router.js +17 -3
- package/dist/lib/core/server/fast-router.js.map +1 -1
- package/dist/lib/core/server/index.js +2 -2
- package/dist/lib/core/server/index.js.map +1 -1
- package/dist/lib/core/server/response.js +21 -1
- package/dist/lib/core/server/response.js.map +1 -1
- package/dist/lib/core/types/index.d.ts +32 -27
- package/package.json +7 -4
- package/dist/cli/app.d.ts +0 -1
- package/dist/cli/app.js.map +0 -1
- package/dist/cli/controller.d.ts +0 -1
- package/dist/cli/controller.js +0 -158
- package/dist/cli/controller.js.map +0 -1
- package/dist/lib/core/compiler/types.js.map +0 -1
- /package/dist/lib/core/{compiler → client}/types.js +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
3
|
+
exports.AppTemplate = void 0;
|
|
4
|
+
exports.AppTemplate = `
|
|
5
5
|
import Spear from "tspace-spear";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const app = new Spear({
|
|
8
8
|
logger: true,
|
|
9
9
|
controllers: {
|
|
10
|
-
folder: \`\${__dirname}/
|
|
11
|
-
name: /controller
|
|
10
|
+
folder: \`\${__dirname}/modules/*\`,
|
|
11
|
+
name: /controller\\\.(ts|js)$/i,
|
|
12
12
|
|
|
13
13
|
// don't forget to set this option for auto-generate route metadata for type-safe E2E usage,
|
|
14
14
|
// and swagger documentation. By default if use .useSwagger() in app no need to set any description
|
|
@@ -16,13 +16,27 @@ export const app = new Spear({
|
|
|
16
16
|
}
|
|
17
17
|
})
|
|
18
18
|
|
|
19
|
+
app.cors({
|
|
20
|
+
origins: [
|
|
21
|
+
/^http:\\/\\/localhost:\\d+$/\
|
|
22
|
+
|
|
23
|
+
],
|
|
24
|
+
credentials: true
|
|
25
|
+
});
|
|
26
|
+
|
|
19
27
|
app.useGlobalPrefix("api");
|
|
20
28
|
app.useSwagger();
|
|
21
29
|
app.useBodyParser();
|
|
22
30
|
|
|
23
31
|
app.listen(8000 , ({ port , server }) => {
|
|
24
32
|
console.log(\`Server listening on : http://localhost:\${port}\`)
|
|
25
|
-
console.log(
|
|
26
|
-
})
|
|
33
|
+
console.log(\`Docs listening on : http://localhost:\${port}/api/docs\`)
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
type AppRouter = typeof app.contract;
|
|
37
|
+
|
|
38
|
+
export { AppRouter };
|
|
39
|
+
export { app };
|
|
40
|
+
export default app;
|
|
27
41
|
`;
|
|
28
|
-
//# sourceMappingURL=
|
|
42
|
+
//# sourceMappingURL=template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/cli/generators/app/template.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqC1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ClientTemplate = "\n// for example E2E\nimport { AppRouter } from \".\";\nimport { ApiClient } from \"tspace-spear/client\";\n\nconst client: ApiClient<AppRouter> = new ApiClient(\n \"http://localhost:8000/api\"\n);\n\nasync function main() { \n \n const res = await client.get(\"/cats\");\n res.data.cats = 1 // Type error: Type 'number' is not assignable to type '{ id: number; name: string; age: number; }[]'\n res.data.cats[0].name = 1 // Type error: Type 'number' is not assignable to type 'string'\n res.data.cats[0].age = \"1.6\" // Type error: Type 'string' is not assignable to type 'number'\n\n console.log(res) \n // res.ok -> boolean\n // res.status -> number\n // res.data -> { cats: [{ id: 1, name: 'cat1', age: 1.6 },{ id: 2, name: 'cat2', age: 1.8 }] }\n\n await client.get(\"/catsq\"); // Type error: Argument of type '\"/catsq\"' is not assignable to parameter of type '\"/cats\" | \"/cats/:id\" | ... 3 more\n \n}\nmain()\n";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientTemplate = void 0;
|
|
4
|
+
exports.ClientTemplate = `
|
|
5
|
+
// for example E2E
|
|
6
|
+
import { AppRouter } from ".";
|
|
7
|
+
import { ApiClient } from "tspace-spear/client";
|
|
8
|
+
|
|
9
|
+
const client: ApiClient<AppRouter> = new ApiClient(
|
|
10
|
+
"http://localhost:8000/api"
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
async function main() {
|
|
14
|
+
|
|
15
|
+
const res = await client.get("/cats");
|
|
16
|
+
res.data.cats = 1 // Type error: Type 'number' is not assignable to type '{ id: number; name: string; age: number; }[]'
|
|
17
|
+
res.data.cats[0].name = 1 // Type error: Type 'number' is not assignable to type 'string'
|
|
18
|
+
res.data.cats[0].age = "1.6" // Type error: Type 'string' is not assignable to type 'number'
|
|
19
|
+
|
|
20
|
+
console.log(res)
|
|
21
|
+
// res.ok -> boolean
|
|
22
|
+
// res.status -> number
|
|
23
|
+
// res.data -> { cats: [{ id: 1, name: 'cat1', age: 1.6 },{ id: 2, name: 'cat2', age: 1.8 }] }
|
|
24
|
+
|
|
25
|
+
await client.get("/catsq"); // Type error: Argument of type '"/catsq"' is not assignable to parameter of type '"/cats" | "/cats/:id" | ... 3 more
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
main()
|
|
29
|
+
`;
|
|
30
|
+
//# sourceMappingURL=template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/cli/generators/client/template.ts"],"names":[],"mappings":";;;AACa,QAAA,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;CAyB7B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createController(root: string, name?: string): void;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createController = createController;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const shared_1 = require("../shared");
|
|
10
|
+
function createController(root, name) {
|
|
11
|
+
if (!name) {
|
|
12
|
+
console.log("Missing controller path, try spear g controller dog");
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
const resolvedPath = path_1.default.resolve(process.cwd(), root, 'modules', (0, shared_1.toPlural)(name));
|
|
16
|
+
const fileName = `${(0, shared_1.toSingular)(name)}.controller.ts`;
|
|
17
|
+
const target = path_1.default.join(resolvedPath, fileName);
|
|
18
|
+
fs_1.default.mkdirSync(resolvedPath, { recursive: true });
|
|
19
|
+
const className = (0, shared_1.capitalize)((0, shared_1.toSingular)(name)) + "Controller";
|
|
20
|
+
fs_1.default.writeFileSync(target, `
|
|
21
|
+
import {
|
|
22
|
+
type T,
|
|
23
|
+
Controller,
|
|
24
|
+
Get,
|
|
25
|
+
Post,
|
|
26
|
+
Put,
|
|
27
|
+
Delete
|
|
28
|
+
} from "tspace-spear";
|
|
29
|
+
|
|
30
|
+
@Controller("/${name}")
|
|
31
|
+
class ${className} {
|
|
32
|
+
|
|
33
|
+
@Get("/")
|
|
34
|
+
async index() {
|
|
35
|
+
return {};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@Get("/:id")
|
|
39
|
+
async show({
|
|
40
|
+
params
|
|
41
|
+
}: T.Context<{ params: { id: number } }>) {
|
|
42
|
+
return { id: params.id };
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@Post("/")
|
|
46
|
+
async create({
|
|
47
|
+
body
|
|
48
|
+
}: T.Context<{ body: {} }>) {
|
|
49
|
+
return { body };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@Put("/:id")
|
|
53
|
+
async update({
|
|
54
|
+
params,
|
|
55
|
+
body
|
|
56
|
+
}: T.Context<{ params: { id: number }; body: {} }>) {
|
|
57
|
+
return { id: params.id, body };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@Delete("/:id")
|
|
61
|
+
async remove({
|
|
62
|
+
params
|
|
63
|
+
}: T.Context<{ params: { id: number } }>) {
|
|
64
|
+
return { id: params.id };
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { ${className} };
|
|
69
|
+
export default ${className};
|
|
70
|
+
`);
|
|
71
|
+
console.log(`
|
|
72
|
+
CREATE ${target}
|
|
73
|
+
|
|
74
|
+
✔ Successfully generated controller "${name}"
|
|
75
|
+
|
|
76
|
+
`);
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cli/generators/controller/index.ts"],"names":[],"mappings":";;;;;AAQA,4CA6EC;AArFD,4CAAoB;AACpB,gDAAwB;AACxB,sCAImB;AAEnB,SAAgB,gBAAgB,CAAC,IAAa,EAAC,IAAa;IAC1D,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAC;QACnE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,YAAY,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,EAAG,SAAS,EAAE,IAAA,iBAAQ,EAAC,IAAI,CAAC,CAAC,CAAC;IAEnF,MAAM,QAAQ,GAAG,GAAG,IAAA,mBAAU,EAAC,IAAI,CAAC,gBAAgB,CAAC;IAErD,MAAM,MAAM,GAAG,cAAI,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IAEjD,YAAE,CAAC,SAAS,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAEhD,MAAM,SAAS,GAAG,IAAA,mBAAU,EAAC,IAAA,mBAAU,EAAC,IAAI,CAAC,CAAC,GAAG,YAAY,CAAC;IAE9D,YAAE,CAAC,aAAa,CACd,MAAM,EACN;;;;;;;;;;gBAUY,IAAI;QACZ,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAqCN,SAAS;iBACH,SAAS;CACzB,CACE,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC;WACH,MAAM;;uCAEsB,IAAI;;CAE1C,CAAC,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ControllerTemplate = "\nimport {\n type T,\n Controller,\n Middleware,\n Get,\n Post,\n Put,\n Delete,\n ValidateDto\n} from \"tspace-spear\";\nimport { CatService } from \"./cat.service\";\nimport { CreateCatDto , UpdateCatDto } from \"./cat.dto\";\nimport { LogMiddleware } from \"../../common/middlewares/log.middleware\";\n\n@Controller(\"/cats\")\nclass CatController {\n\n constructor(\n private catService: CatService = new CatService()\n ) {}\n\n @Get(\"/\")\n @Middleware(LogMiddleware)\n async index() {\n const cats = this.catService.index();\n return { cats };\n }\n\n @Get(\"/:id\")\n @Middleware(LogMiddleware)\n async show({\n params\n }: T.Context<{\n params: {\n id: number;\n };\n }>) {\n const cat = this.catService.show(+params.id);\n return { cat }\n }\n\n @Post(\"/\")\n @ValidateDto(CreateCatDto)\n @Middleware(LogMiddleware)\n async create({\n body\n }: T.Context<{\n body: CreateCatDto;\n }>) {\n\n const cat = this.catService\n .create({ \n name: body.name, \n age: body.age \n });\n\n return { cat };\n }\n\n @Put(\"/:id\")\n @ValidateDto(UpdateCatDto)\n @Middleware(LogMiddleware)\n async update({\n params,\n body\n }: T.Context<{\n params: {\n id: number;\n };\n body: UpdateCatDto;\n }>) {\n\n const cat = this.catService\n .update(+params.id, { \n name: body.name, \n age: body.age \n });\n\n return { cat }\n }\n\n @Delete(\"/:id\")\n @Middleware(LogMiddleware)\n async remove({\n params\n }: T.Context<{\n params: {\n id: number;\n };\n }>) {\n\n const deleted = this.catService\n .remove(+params.id);\n\n return deleted;\n }\n}\n\nexport { CatController };\nexport default CatController;\n";
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ControllerTemplate = void 0;
|
|
4
|
+
exports.ControllerTemplate = `
|
|
5
|
+
import {
|
|
6
|
+
type T,
|
|
7
|
+
Controller,
|
|
8
|
+
Middleware,
|
|
9
|
+
Get,
|
|
10
|
+
Post,
|
|
11
|
+
Put,
|
|
12
|
+
Delete,
|
|
13
|
+
ValidateDto
|
|
14
|
+
} from "tspace-spear";
|
|
15
|
+
import { CatService } from "./cat.service";
|
|
16
|
+
import { CreateCatDto , UpdateCatDto } from "./cat.dto";
|
|
17
|
+
import { LogMiddleware } from "../../common/middlewares/log.middleware";
|
|
18
|
+
|
|
19
|
+
@Controller("/cats")
|
|
20
|
+
class CatController {
|
|
21
|
+
|
|
22
|
+
constructor(
|
|
23
|
+
private catService: CatService = new CatService()
|
|
24
|
+
) {}
|
|
25
|
+
|
|
26
|
+
@Get("/")
|
|
27
|
+
@Middleware(LogMiddleware)
|
|
28
|
+
async index() {
|
|
29
|
+
const cats = this.catService.index();
|
|
30
|
+
return { cats };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@Get("/:id")
|
|
34
|
+
@Middleware(LogMiddleware)
|
|
35
|
+
async show({
|
|
36
|
+
params
|
|
37
|
+
}: T.Context<{
|
|
38
|
+
params: {
|
|
39
|
+
id: number;
|
|
40
|
+
};
|
|
41
|
+
}>) {
|
|
42
|
+
const cat = this.catService.show(+params.id);
|
|
43
|
+
return { cat }
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@Post("/")
|
|
47
|
+
@ValidateDto(CreateCatDto)
|
|
48
|
+
@Middleware(LogMiddleware)
|
|
49
|
+
async create({
|
|
50
|
+
body
|
|
51
|
+
}: T.Context<{
|
|
52
|
+
body: CreateCatDto;
|
|
53
|
+
}>) {
|
|
54
|
+
|
|
55
|
+
const cat = this.catService
|
|
56
|
+
.create({
|
|
57
|
+
name: body.name,
|
|
58
|
+
age: body.age
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
return { cat };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@Put("/:id")
|
|
65
|
+
@ValidateDto(UpdateCatDto)
|
|
66
|
+
@Middleware(LogMiddleware)
|
|
67
|
+
async update({
|
|
68
|
+
params,
|
|
69
|
+
body
|
|
70
|
+
}: T.Context<{
|
|
71
|
+
params: {
|
|
72
|
+
id: number;
|
|
73
|
+
};
|
|
74
|
+
body: UpdateCatDto;
|
|
75
|
+
}>) {
|
|
76
|
+
|
|
77
|
+
const cat = this.catService
|
|
78
|
+
.update(+params.id, {
|
|
79
|
+
name: body.name,
|
|
80
|
+
age: body.age
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
return { cat }
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@Delete("/:id")
|
|
87
|
+
@Middleware(LogMiddleware)
|
|
88
|
+
async remove({
|
|
89
|
+
params
|
|
90
|
+
}: T.Context<{
|
|
91
|
+
params: {
|
|
92
|
+
id: number;
|
|
93
|
+
};
|
|
94
|
+
}>) {
|
|
95
|
+
|
|
96
|
+
const deleted = this.catService
|
|
97
|
+
.remove(+params.id);
|
|
98
|
+
|
|
99
|
+
return deleted;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export { CatController };
|
|
104
|
+
export default CatController;
|
|
105
|
+
`;
|
|
106
|
+
//# sourceMappingURL=template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/cli/generators/controller/template.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqGjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createDto(root: string, name?: string): void;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createDto = createDto;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const shared_1 = require("../shared");
|
|
10
|
+
function createDto(root, name) {
|
|
11
|
+
if (!name) {
|
|
12
|
+
console.log("Missing dto path, try spear g dto dog");
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
const resolvedPath = path_1.default.resolve(process.cwd(), root, 'modules', (0, shared_1.toPlural)(name));
|
|
16
|
+
const fileName = `${(0, shared_1.toSingular)(name)}.dto.ts`;
|
|
17
|
+
const target = path_1.default.join(resolvedPath, fileName);
|
|
18
|
+
fs_1.default.mkdirSync(resolvedPath, { recursive: true });
|
|
19
|
+
const className = (0, shared_1.capitalize)((0, shared_1.toSingular)(name)) + "Dto";
|
|
20
|
+
fs_1.default.writeFileSync(target, `
|
|
21
|
+
import {
|
|
22
|
+
IsString,
|
|
23
|
+
Min,
|
|
24
|
+
IsNotEmpty,
|
|
25
|
+
IsNumber,
|
|
26
|
+
IsOptional
|
|
27
|
+
} from "class-validator";
|
|
28
|
+
|
|
29
|
+
export class Create${className} {
|
|
30
|
+
@IsString()
|
|
31
|
+
@IsNotEmpty()
|
|
32
|
+
name!: string;
|
|
33
|
+
|
|
34
|
+
@IsNumber()
|
|
35
|
+
@Min(0.1)
|
|
36
|
+
age!: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export class Update${className} {
|
|
40
|
+
@IsOptional()
|
|
41
|
+
@IsString()
|
|
42
|
+
name?: string;
|
|
43
|
+
|
|
44
|
+
@IsOptional()
|
|
45
|
+
@IsNumber()
|
|
46
|
+
@Min(0.1)
|
|
47
|
+
age?: number;
|
|
48
|
+
}
|
|
49
|
+
`);
|
|
50
|
+
console.log(`
|
|
51
|
+
CREATE ${target}
|
|
52
|
+
|
|
53
|
+
✔ Successfully generated dto "${name}"
|
|
54
|
+
|
|
55
|
+
`);
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cli/generators/dto/index.ts"],"names":[],"mappings":";;;;;AAQA,8BAwDC;AAhED,4CAAoB;AACpB,gDAAwB;AACxB,sCAImB;AAEnB,SAAgB,SAAS,CAAC,IAAa,EAAC,IAAa;IACjD,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;QACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAEH,MAAM,YAAY,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,EAAG,SAAS,EAAE,IAAA,iBAAQ,EAAC,IAAI,CAAC,CAAC,CAAC;IAEnF,MAAM,QAAQ,GAAG,GAAG,IAAA,mBAAU,EAAC,IAAI,CAAC,SAAS,CAAC;IAE9C,MAAM,MAAM,GAAG,cAAI,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IAEjD,YAAE,CAAC,SAAS,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAEhD,MAAM,SAAS,GAAG,IAAA,mBAAU,EAAC,IAAA,mBAAU,EAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC;IAEvD,YAAE,CAAC,aAAa,CACd,MAAM,EACN;;;;;;;;;qBASiB,SAAS;;;;;;;;;;qBAUT,SAAS;;;;;;;;;;CAU7B,CACE,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC;WACF,MAAM;;gCAEe,IAAI;;CAEnC,CAAC,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DtoTemplate = "\nimport {\n IsString,\n Min,\n IsNotEmpty,\n IsNumber,\n} from \"class-validator\";\n\nexport class CreateCatDto {\n @IsString()\n @IsNotEmpty()\n name!: string;\n\n @IsNumber()\n @Min(0.1)\n age!: number;\n}\n\nexport class UpdateCatDto {\n @IsString()\n @IsNotEmpty()\n name!: string;\n\n @IsNumber()\n @Min(0.1)\n age!: number;\n}\n";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DtoTemplate = void 0;
|
|
4
|
+
exports.DtoTemplate = `
|
|
5
|
+
import {
|
|
6
|
+
IsString,
|
|
7
|
+
Min,
|
|
8
|
+
IsNotEmpty,
|
|
9
|
+
IsNumber,
|
|
10
|
+
} from "class-validator";
|
|
11
|
+
|
|
12
|
+
export class CreateCatDto {
|
|
13
|
+
@IsString()
|
|
14
|
+
@IsNotEmpty()
|
|
15
|
+
name!: string;
|
|
16
|
+
|
|
17
|
+
@IsNumber()
|
|
18
|
+
@Min(0.1)
|
|
19
|
+
age!: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export class UpdateCatDto {
|
|
23
|
+
@IsString()
|
|
24
|
+
@IsNotEmpty()
|
|
25
|
+
name!: string;
|
|
26
|
+
|
|
27
|
+
@IsNumber()
|
|
28
|
+
@Min(0.1)
|
|
29
|
+
age!: number;
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
//# sourceMappingURL=template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/cli/generators/dto/template.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2B1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createMiddleware(root: string, name?: string): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createMiddleware = createMiddleware;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const shared_1 = require("../shared");
|
|
10
|
+
function createMiddleware(root, name) {
|
|
11
|
+
if (!name) {
|
|
12
|
+
console.log("Missing middleware path, try spear g middleware log");
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
const resolvedPath = path_1.default.resolve(process.cwd(), root, "common", "middlewares");
|
|
16
|
+
const fileName = `${(0, shared_1.toSingular)(name)}.middleware.ts`;
|
|
17
|
+
const target = path_1.default.join(resolvedPath, fileName);
|
|
18
|
+
fs_1.default.mkdirSync(resolvedPath, { recursive: true });
|
|
19
|
+
const middleName = (0, shared_1.capitalize)((0, shared_1.toSingular)(name)) + "Middleware";
|
|
20
|
+
fs_1.default.writeFileSync(target, `
|
|
21
|
+
import { type T } from "tspace-spear";
|
|
22
|
+
|
|
23
|
+
const ${middleName} = async (ctx : T.Context, next: T.NextFunction) => {
|
|
24
|
+
console.log('hello: ${middleName}')
|
|
25
|
+
return next();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { ${middleName} };
|
|
29
|
+
export default ${middleName};
|
|
30
|
+
`);
|
|
31
|
+
console.log(`
|
|
32
|
+
CREATE ${target}
|
|
33
|
+
|
|
34
|
+
✔ Successfully generated middleware "${name}"
|
|
35
|
+
|
|
36
|
+
`);
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cli/generators/middleware/index.ts"],"names":[],"mappings":";;;;;AAKA,4CAqCC;AA1CD,4CAAoB;AACpB,gDAAwB;AACxB,sCAAmD;AAGnD,SAAgB,gBAAgB,CAAC,IAAY,EAAE,IAAa;IAC1D,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAC;QACnE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,YAAY,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,EAAG,QAAQ,EAAE,aAAa,CAAC,CAAC;IAEjF,MAAM,QAAQ,GAAG,GAAG,IAAA,mBAAU,EAAC,IAAI,CAAC,gBAAgB,CAAC;IAErD,MAAM,MAAM,GAAG,cAAI,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IAEjD,YAAE,CAAC,SAAS,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAEhD,MAAM,UAAU,GAAG,IAAA,mBAAU,EAAC,IAAA,mBAAU,EAAC,IAAI,CAAC,CAAC,GAAG,YAAY,CAAC;IAE/D,YAAE,CAAC,aAAa,CACd,MAAM,EACN;;;QAGI,UAAU;wBACM,UAAU;;;;WAIvB,UAAU;iBACJ,UAAU;CAC1B,CACE,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC;WACH,MAAM;;uCAEsB,IAAI;;CAE1C,CAAC,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MiddlewareTemplate = "\nimport { type T } from \"tspace-spear\";\n\nconst sleep = async (ms : number) => new Promise(resolve => setTimeout(resolve, ms))\n\nexport const LogMiddleware = async (ctx : T.Context, next: T.NextFunction) =>{\n await sleep(100);\n console.log('after logging middleware Meow!');\n ctx.req.cat = 'Meow!';\n return next()\n}\n";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MiddlewareTemplate = void 0;
|
|
4
|
+
exports.MiddlewareTemplate = `
|
|
5
|
+
import { type T } from "tspace-spear";
|
|
6
|
+
|
|
7
|
+
const sleep = async (ms : number) => new Promise(resolve => setTimeout(resolve, ms))
|
|
8
|
+
|
|
9
|
+
export const LogMiddleware = async (ctx : T.Context, next: T.NextFunction) =>{
|
|
10
|
+
await sleep(100);
|
|
11
|
+
console.log('after logging middleware Meow!');
|
|
12
|
+
ctx.req.cat = 'Meow!';
|
|
13
|
+
return next()
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
//# sourceMappingURL=template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/cli/generators/middleware/template.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG;;;;;;;;;;;CAWjC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createModule(root: string, name?: string): void;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createModule = createModule;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const shared_1 = require("../shared");
|
|
10
|
+
function createModule(root, name) {
|
|
11
|
+
if (!name) {
|
|
12
|
+
console.log("Missing module path, try spear g module dogs");
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
const modulePath = path_1.default.resolve(process.cwd(), root, 'modules', (0, shared_1.toPlural)(name));
|
|
16
|
+
fs_1.default.mkdirSync(modulePath, { recursive: true });
|
|
17
|
+
const controllerPath = path_1.default.resolve(process.cwd(), root, "modules", (0, shared_1.toPlural)(name), `${(0, shared_1.toSingular)(name)}.controller.ts`);
|
|
18
|
+
const servicePath = path_1.default.resolve(process.cwd(), root, "modules", (0, shared_1.toPlural)(name), `${(0, shared_1.toSingular)(name)}.service.ts`);
|
|
19
|
+
const dtoPath = path_1.default.resolve(process.cwd(), root, "modules", (0, shared_1.toPlural)(name), `${(0, shared_1.toSingular)(name)}.dto.ts`);
|
|
20
|
+
const controllerName = (0, shared_1.capitalize)((0, shared_1.toSingular)(name)) + "Controller";
|
|
21
|
+
const serviceName = (0, shared_1.capitalize)((0, shared_1.toSingular)(name)) + "Service";
|
|
22
|
+
const dtoName = (0, shared_1.capitalize)((0, shared_1.toSingular)(name)) + "Dto";
|
|
23
|
+
fs_1.default.writeFileSync(controllerPath, `import {
|
|
24
|
+
type T,
|
|
25
|
+
Controller,
|
|
26
|
+
Get,
|
|
27
|
+
Post,
|
|
28
|
+
Put,
|
|
29
|
+
Patch,
|
|
30
|
+
Delete,
|
|
31
|
+
ValidateDto
|
|
32
|
+
} from "tspace-spear";
|
|
33
|
+
|
|
34
|
+
import { ${serviceName} } from "./${(0, shared_1.toSingular)(name)}.service";
|
|
35
|
+
|
|
36
|
+
import {
|
|
37
|
+
Create${dtoName},
|
|
38
|
+
Update${dtoName}
|
|
39
|
+
} from "./${(0, shared_1.toSingular)(name)}.dto";
|
|
40
|
+
|
|
41
|
+
@Controller("/${name}")
|
|
42
|
+
class ${controllerName} {
|
|
43
|
+
|
|
44
|
+
constructor(
|
|
45
|
+
private ${(0, shared_1.toSingular)(name)}Service: ${serviceName} = new ${serviceName}()
|
|
46
|
+
) {}
|
|
47
|
+
|
|
48
|
+
@Get("/")
|
|
49
|
+
async index() {
|
|
50
|
+
return this.${(0, shared_1.toSingular)(name)}Service.index();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@Get("/:id")
|
|
54
|
+
async show({
|
|
55
|
+
params
|
|
56
|
+
}: T.Context<{ params: { id: number } }>) {
|
|
57
|
+
return this.${(0, shared_1.toSingular)(name)}Service.show(+params.id);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@Post("/")
|
|
61
|
+
@ValidateDto(Create${dtoName})
|
|
62
|
+
async create({
|
|
63
|
+
body
|
|
64
|
+
}: T.Context<{ body: Create${dtoName} }>) {
|
|
65
|
+
return this.${(0, shared_1.toSingular)(name)}Service
|
|
66
|
+
.create({
|
|
67
|
+
name: body.name,
|
|
68
|
+
age: body.age
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@Put("/:id")
|
|
73
|
+
@Patch("/:id")
|
|
74
|
+
@ValidateDto(Update${dtoName})
|
|
75
|
+
async update({
|
|
76
|
+
params,
|
|
77
|
+
body
|
|
78
|
+
}: T.Context<{
|
|
79
|
+
params: { id: number };
|
|
80
|
+
body: Update${dtoName};
|
|
81
|
+
}>) {
|
|
82
|
+
|
|
83
|
+
return this.${(0, shared_1.toSingular)(name)}Service
|
|
84
|
+
.update(+params.id, {
|
|
85
|
+
name: body.name,
|
|
86
|
+
age: body.age
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@Delete("/:id")
|
|
91
|
+
async remove({
|
|
92
|
+
params
|
|
93
|
+
}: T.Context<{ params: { id: number } }>) {
|
|
94
|
+
return this.${(0, shared_1.toSingular)(name)}Service
|
|
95
|
+
.remove(+params.id);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export { ${controllerName} };
|
|
100
|
+
export default ${controllerName};
|
|
101
|
+
`);
|
|
102
|
+
fs_1.default.writeFileSync(servicePath, `import {
|
|
103
|
+
Create${dtoName},
|
|
104
|
+
Update${dtoName}
|
|
105
|
+
} from "./${(0, shared_1.toSingular)(name)}.dto";
|
|
106
|
+
|
|
107
|
+
class ${serviceName} {
|
|
108
|
+
public async index() {
|
|
109
|
+
return [];
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
public async show(id: number) {
|
|
113
|
+
return {};
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
public async create(body : Create${dtoName}) {
|
|
117
|
+
return {};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
public async update(id: number, body: Update${dtoName}) {
|
|
121
|
+
return {};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
public async remove(id: number) {
|
|
125
|
+
return {};
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export { ${serviceName} };
|
|
130
|
+
export default ${serviceName};
|
|
131
|
+
`);
|
|
132
|
+
fs_1.default.writeFileSync(dtoPath, `import {
|
|
133
|
+
IsString,
|
|
134
|
+
Min,
|
|
135
|
+
IsNotEmpty,
|
|
136
|
+
IsNumber,
|
|
137
|
+
} from "class-validator";
|
|
138
|
+
|
|
139
|
+
export class Create${dtoName} {
|
|
140
|
+
@IsString()
|
|
141
|
+
@IsNotEmpty()
|
|
142
|
+
name!: string;
|
|
143
|
+
|
|
144
|
+
@IsNumber()
|
|
145
|
+
@Min(0.1)
|
|
146
|
+
age!: number;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export class Update${dtoName} {
|
|
150
|
+
@IsString()
|
|
151
|
+
@IsNotEmpty()
|
|
152
|
+
name!: string;
|
|
153
|
+
|
|
154
|
+
@IsNumber()
|
|
155
|
+
@Min(0.1)
|
|
156
|
+
age!: number;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
`);
|
|
160
|
+
console.log(`
|
|
161
|
+
CREATE ${modulePath}
|
|
162
|
+
CREATE ${controllerPath}
|
|
163
|
+
CREATE ${servicePath}
|
|
164
|
+
CREATE ${dtoPath}
|
|
165
|
+
|
|
166
|
+
✔ Successfully generated module "${name}"
|
|
167
|
+
|
|
168
|
+
Controller ${controllerName}
|
|
169
|
+
Service ${serviceName}
|
|
170
|
+
DTO ${dtoName}
|
|
171
|
+
`);
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cli/generators/module/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createService(root: string, name?: string): void;
|