create-craftjs 1.0.4 → 1.0.6

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.
Files changed (67) hide show
  1. package/README.md +139 -137
  2. package/bin/index.js +158 -158
  3. package/package.json +24 -24
  4. package/template/Dockerfile +57 -12
  5. package/template/babel.config.json +3 -3
  6. package/template/craft/commands/build.js +16 -15
  7. package/template/craft/commands/db-fresh.js +22 -22
  8. package/template/craft/commands/db-generate.js +23 -23
  9. package/template/craft/commands/db-migrate.js +22 -22
  10. package/template/craft/commands/dev.js +16 -16
  11. package/template/craft/commands/key-generate.js +41 -41
  12. package/template/craft/commands/make-apidocs.js +121 -121
  13. package/template/craft/commands/make-command.js +38 -38
  14. package/template/craft/commands/make-controller.js +95 -95
  15. package/template/craft/commands/make-dto.js +39 -39
  16. package/template/craft/commands/make-middleware.js +46 -46
  17. package/template/craft/commands/make-repository.js +36 -36
  18. package/template/craft/commands/make-route.js +92 -92
  19. package/template/craft/commands/make-service.js +39 -39
  20. package/template/craft/commands/make-test.js +48 -48
  21. package/template/craft/commands/make-utils.js +30 -30
  22. package/template/craft/commands/make-validation.js +42 -42
  23. package/template/craft/commands/make-view.js +42 -42
  24. package/template/craft/commands/start.js +29 -29
  25. package/template/craft/commands/test.js +20 -20
  26. package/template/craft.js +256 -256
  27. package/template/docker-compose.yml +8 -0
  28. package/template/nodemon.json +6 -6
  29. package/template/package-lock.json +8877 -8877
  30. package/template/package.json +84 -84
  31. package/template/prisma/schema.prisma +22 -22
  32. package/template/prisma/seed.ts +29 -29
  33. package/template/src/apidocs/auth-docs.ts +314 -314
  34. package/template/src/apidocs/users-docs.ts +240 -240
  35. package/template/src/config/cloudinary.ts +21 -21
  36. package/template/src/config/database.ts +90 -90
  37. package/template/src/config/env.ts +67 -67
  38. package/template/src/config/logger.ts +139 -139
  39. package/template/src/config/nodemailer.ts +23 -23
  40. package/template/src/config/web.ts +47 -47
  41. package/template/src/controllers/auth-controller.ts +88 -88
  42. package/template/src/controllers/user-controller.ts +79 -79
  43. package/template/src/dtos/list-dto.ts +12 -12
  44. package/template/src/dtos/user-dto.ts +57 -57
  45. package/template/src/main.ts +28 -28
  46. package/template/src/middleware/auth-middleware.ts +44 -44
  47. package/template/src/middleware/error-middleware.ts +27 -27
  48. package/template/src/middleware/http-logger-middleware.ts +31 -31
  49. package/template/src/repositories/user-repository.ts +75 -75
  50. package/template/src/routes/auth-route.ts +20 -20
  51. package/template/src/routes/main-route.ts +25 -25
  52. package/template/src/routes/user-route.ts +35 -35
  53. package/template/src/services/auth-service.ts +162 -162
  54. package/template/src/services/user-service.ts +102 -102
  55. package/template/src/types/type-request.ts +6 -6
  56. package/template/src/utils/async-handler.ts +9 -9
  57. package/template/src/utils/response-error.ts +10 -10
  58. package/template/src/utils/response.ts +60 -60
  59. package/template/src/utils/swagger.ts +135 -135
  60. package/template/src/utils/validation.ts +7 -7
  61. package/template/src/validations/user-validation.ts +127 -127
  62. package/template/src/views/index.ejs +6 -6
  63. package/template/src/views/layouts/main.ejs +14 -14
  64. package/template/src/views/partials/header.ejs +3 -3
  65. package/template/test/user.test.ts +16 -16
  66. package/template/tsconfig.json +13 -13
  67. package/template/.dockerignore +0 -4
@@ -1,14 +1,14 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title><%= title %></title>
7
- <script src="https://cdn.tailwindcss.com"></script>
8
- </head>
9
- <body class="bg-gray-50 text-gray-800">
10
- <%- include("../partials/header") %>
11
-
12
- <main class="p-6"><%- body %></main>
13
- </body>
14
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title><%= title %></title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ </head>
9
+ <body class="bg-gray-50 text-gray-800">
10
+ <%- include("../partials/header") %>
11
+
12
+ <main class="p-6"><%- body %></main>
13
+ </body>
14
+ </html>
@@ -1,3 +1,3 @@
1
- <header class="bg-blue-600 text-white p-4">
2
- <h1 class="text-xl font-semibold">CraftJS</h1>
3
- </header>
1
+ <header class="bg-blue-600 text-white p-4">
2
+ <h1 class="text-xl font-semibold">CraftJS</h1>
3
+ </header>
@@ -1,16 +1,16 @@
1
- import supertest from "supertest";
2
- import { web } from "../src/application/web";
3
- import { logger } from "../src/application/logging";
4
- describe("POST /api/users", () => {
5
- it("should register new user", async () => {
6
- const response = await supertest(web).post("/api/auth/register").send({
7
- fullName: "test",
8
- email: "testing@gmail.com",
9
- password: "12345678",
10
- });
11
- logger.debug(response.body);
12
- expect(response.status).toBe(201);
13
- expect(response.body.data.fullName).toBe("test");
14
- expect(response.body.data.email).toBe("testing@gmail.com");
15
- });
16
- });
1
+ import supertest from "supertest";
2
+ import { web } from "../src/application/web";
3
+ import { logger } from "../src/application/logging";
4
+ describe("POST /api/users", () => {
5
+ it("should register new user", async () => {
6
+ const response = await supertest(web).post("/api/auth/register").send({
7
+ fullName: "test",
8
+ email: "testing@gmail.com",
9
+ password: "12345678",
10
+ });
11
+ logger.debug(response.body);
12
+ expect(response.status).toBe(201);
13
+ expect(response.body.data.fullName).toBe("test");
14
+ expect(response.body.data.email).toBe("testing@gmail.com");
15
+ });
16
+ });
@@ -1,13 +1,13 @@
1
- {
2
- "include": ["src/**/*", "craft.js"],
3
- "compilerOptions": {
4
- "target": "es2016",
5
- "module": "commonjs",
6
- "moduleResolution": "Node",
7
- "outDir": "./dist",
8
- "esModuleInterop": true,
9
- "forceConsistentCasingInFileNames": true,
10
- "strict": true,
11
- "skipLibCheck": true
12
- }
13
- }
1
+ {
2
+ "include": ["src/**/*", "craft.js"],
3
+ "compilerOptions": {
4
+ "target": "es2016",
5
+ "module": "commonjs",
6
+ "moduleResolution": "Node",
7
+ "outDir": "./build",
8
+ "esModuleInterop": true,
9
+ "forceConsistentCasingInFileNames": true,
10
+ "strict": true,
11
+ "skipLibCheck": true
12
+ }
13
+ }
@@ -1,4 +0,0 @@
1
- node_modules
2
- dist
3
- Dockerfile
4
- .dockerignore