create-warlock 4.2.6 → 4.2.8

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 (95) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/package.json +2 -2
  3. package/templates/warlock/.env.example +36 -0
  4. package/templates/warlock/.gitattributes +1 -0
  5. package/templates/warlock/.husky/pre-commit +4 -0
  6. package/templates/warlock/.prettierignore +4 -0
  7. package/templates/warlock/.prettierrc.json +10 -0
  8. package/templates/warlock/.vscode/settings.json +41 -0
  9. package/templates/warlock/README.md +57 -0
  10. package/templates/warlock/_.gitignore +6 -0
  11. package/templates/warlock/docs/new-module.md +551 -0
  12. package/templates/warlock/eslint.config.js +98 -0
  13. package/templates/warlock/package.json +74 -0
  14. package/templates/warlock/public/home.css +523 -0
  15. package/templates/warlock/skills/api-design/SKILL.md +461 -0
  16. package/templates/warlock/skills/code-standards/SKILL.md +595 -0
  17. package/templates/warlock/skills/data-and-persistence/SKILL.md +330 -0
  18. package/templates/warlock/skills/git-workflow/SKILL.md +282 -0
  19. package/templates/warlock/skills/module-boundaries/SKILL.md +283 -0
  20. package/templates/warlock/skills/observability-and-resilience/SKILL.md +306 -0
  21. package/templates/warlock/skills/security-baseline/SKILL.md +352 -0
  22. package/templates/warlock/skills/testing-strategy/SKILL.md +323 -0
  23. package/templates/warlock/src/app/auth/controllers/forgot-password.controller.ts +28 -0
  24. package/templates/warlock/src/app/auth/controllers/login.controller.ts +22 -0
  25. package/templates/warlock/src/app/auth/controllers/logout-all.controller.ts +16 -0
  26. package/templates/warlock/src/app/auth/controllers/logout.controller.ts +16 -0
  27. package/templates/warlock/src/app/auth/controllers/me.controller.ts +13 -0
  28. package/templates/warlock/src/app/auth/controllers/refresh-token.controller.ts +29 -0
  29. package/templates/warlock/src/app/auth/controllers/reset-password.controller.ts +23 -0
  30. package/templates/warlock/src/app/auth/main.ts +9 -0
  31. package/templates/warlock/src/app/auth/models/otp/index.ts +1 -0
  32. package/templates/warlock/src/app/auth/models/otp/migrations/22-12-2025_10-30-20.otp-migration.ts +30 -0
  33. package/templates/warlock/src/app/auth/models/otp/otp.model.ts +69 -0
  34. package/templates/warlock/src/app/auth/requests/guarded.request.ts +10 -0
  35. package/templates/warlock/src/app/auth/routes.ts +22 -0
  36. package/templates/warlock/src/app/auth/schema/login.schema.ts +8 -0
  37. package/templates/warlock/src/app/auth/schema/reset-password.schema.ts +9 -0
  38. package/templates/warlock/src/app/auth/services/auth.service.ts +66 -0
  39. package/templates/warlock/src/app/auth/services/forgot-password.service.ts +28 -0
  40. package/templates/warlock/src/app/auth/services/otp.service.ts +173 -0
  41. package/templates/warlock/src/app/auth/services/reset-password.service.ts +39 -0
  42. package/templates/warlock/src/app/auth/utils/auth-error-code.ts +6 -0
  43. package/templates/warlock/src/app/auth/utils/locales.ts +89 -0
  44. package/templates/warlock/src/app/auth/utils/types.ts +14 -0
  45. package/templates/warlock/src/app/posts/controllers/create-new-post.controller.ts +21 -0
  46. package/templates/warlock/src/app/posts/controllers/update-post.controller.ts +30 -0
  47. package/templates/warlock/src/app/posts/models/post/migrations/09-01-2026_02-07-51-post.migration.ts +15 -0
  48. package/templates/warlock/src/app/posts/models/post/post.model.ts +23 -0
  49. package/templates/warlock/src/app/posts/resources/post.resource.ts +14 -0
  50. package/templates/warlock/src/app/posts/routes.ts +8 -0
  51. package/templates/warlock/src/app/posts/schema/create-post.schema.ts +9 -0
  52. package/templates/warlock/src/app/posts/schema/update-post.schema.ts +9 -0
  53. package/templates/warlock/src/app/shared/components/HomePageComponent.tsx +229 -0
  54. package/templates/warlock/src/app/shared/controllers/home-page.controller.ts +18 -0
  55. package/templates/warlock/src/app/shared/controllers/home-page.controller.tsx +8 -0
  56. package/templates/warlock/src/app/shared/routes.ts +4 -0
  57. package/templates/warlock/src/app/shared/services/scheduler.service.ts +3 -0
  58. package/templates/warlock/src/app/shared/tests/infrastructure.test.ts +22 -0
  59. package/templates/warlock/src/app/shared/utils/global-columns-schema.ts +8 -0
  60. package/templates/warlock/src/app/shared/utils/locales.ts +766 -0
  61. package/templates/warlock/src/app/shared/utils/router.ts +30 -0
  62. package/templates/warlock/src/app/uploads/controllers/fetch-uploaded-file.controller.ts +33 -0
  63. package/templates/warlock/src/app/uploads/routes.ts +4 -0
  64. package/templates/warlock/src/app/users/commands/hello-world.command.ts +8 -0
  65. package/templates/warlock/src/app/users/controllers/create-new-user.controller.ts +27 -0
  66. package/templates/warlock/src/app/users/controllers/list-users.controller.ts +12 -0
  67. package/templates/warlock/src/app/users/events/inject-created-by-user.into-model.event.ts +32 -0
  68. package/templates/warlock/src/app/users/events/sync.ts +5 -0
  69. package/templates/warlock/src/app/users/main.ts +5 -0
  70. package/templates/warlock/src/app/users/models/user/index.ts +1 -0
  71. package/templates/warlock/src/app/users/models/user/migrations/11-12-2025_23-58-03-user.migration.ts +15 -0
  72. package/templates/warlock/src/app/users/models/user/user.model.ts +64 -0
  73. package/templates/warlock/src/app/users/repositories/users.repository.ts +23 -0
  74. package/templates/warlock/src/app/users/resources/user.resource.ts +14 -0
  75. package/templates/warlock/src/app/users/routes.ts +8 -0
  76. package/templates/warlock/src/app/users/schema/create-user.schema.ts +11 -0
  77. package/templates/warlock/src/app/users/seeds/users.seed.ts +21 -0
  78. package/templates/warlock/src/app/users/services/get-users.service.ts +5 -0
  79. package/templates/warlock/src/app/users/services/list-users.service.ts +17 -0
  80. package/templates/warlock/src/app/users/services/login-social.ts +19 -0
  81. package/templates/warlock/src/config/app.ts +12 -0
  82. package/templates/warlock/src/config/auth.ts +20 -0
  83. package/templates/warlock/src/config/cache.ts +59 -0
  84. package/templates/warlock/src/config/database.ts +65 -0
  85. package/templates/warlock/src/config/http.ts +23 -0
  86. package/templates/warlock/src/config/log.ts +22 -0
  87. package/templates/warlock/src/config/mail.ts +16 -0
  88. package/templates/warlock/src/config/repository.ts +11 -0
  89. package/templates/warlock/src/config/storage.ts +34 -0
  90. package/templates/warlock/src/config/tests.ts +5 -0
  91. package/templates/warlock/src/config/validation.ts +7 -0
  92. package/templates/warlock/storage/.gitignore +2 -0
  93. package/templates/warlock/tsconfig.json +27 -0
  94. package/templates/warlock/warlock.config.ts +15 -0
  95. package/templates/warlock/yarn.lock +2332 -0
package/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## 4.2.7
10
+
11
+ ### Fixed
12
+
13
+ - The published package now ships its `templates/` folder, so scaffolding a new project works from the installed package — it was missing from the build, which made the wizard fail with "Something went wrong" at the template-copy step. The rest of the family is re-published at 4.2.7 to keep the lockstep version line; no other functional changes.
14
+
9
15
  ## 4.2.6
10
16
 
11
17
  ### Fixed
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "dependencies": {
10
10
  "@clack/prompts": "^0.7.0",
11
11
  "@mongez/copper": "^2.1.2",
12
- "@warlock.js/fs": "4.2.6",
12
+ "@warlock.js/fs": "4.2.8",
13
13
  "@mongez/reinforcements": "^3.2.0",
14
14
  "cross-spawn": "^7.0.3",
15
15
  "rimraf": "^6.0.1",
@@ -18,7 +18,7 @@
18
18
  "bin": {
19
19
  "create-warlock": "bin/create-app.js"
20
20
  },
21
- "version": "4.2.6",
21
+ "version": "4.2.8",
22
22
  "type": "module",
23
23
  "main": "./esm/index.mjs",
24
24
  "module": "./esm/index.mjs",
@@ -0,0 +1,36 @@
1
+ # App Configurations
2
+ APP_NAME="appName"
3
+ LOCALE_CODE=en
4
+
5
+ TIMEZONE=UTC
6
+
7
+ # Http Configurations
8
+ HTTP_PORT=2030
9
+ HTTP_HOST=localhost
10
+ BASE_URL=http://${HTTP_HOST}:${HTTP_PORT}
11
+
12
+ # Database Configurations
13
+ DB_AUTH=admin
14
+ DB_PORT=27017
15
+ DB_HOST=localhost
16
+ DB_NAME=appName
17
+ DB_USERNAME=
18
+ DB_PASSWORD=
19
+
20
+ # Cache
21
+ CACHE_DRIVER=memory
22
+ ## Redis
23
+ REDIS_HOST=localhost
24
+ REDIS_PORT=6379
25
+ # or using redis url
26
+ #REDIS_URL=
27
+
28
+ # Mail
29
+ MAIL_HOST=
30
+ MAIL_PORT=465
31
+ MAIL_ENCRYPTION=ssl
32
+ MAIL_SECURE=true
33
+ MAIL_USERNAME=
34
+ MAIL_PASSWORD=
35
+ MAIL_FROM_NAME=${APP_NAME}
36
+ MAIL_FROM_ADDRESS=
@@ -0,0 +1 @@
1
+ * text=auto eol=lf
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env sh
2
+ . "$(dirname -- "$0")/_/husky.sh"
3
+
4
+ npm test
@@ -0,0 +1,4 @@
1
+ node_modules
2
+ dist
3
+
4
+
@@ -0,0 +1,10 @@
1
+ {
2
+ "semi": true,
3
+ "tabWidth": 2,
4
+ "printWidth": 100,
5
+ "singleQuote": false,
6
+ "arrowParens": "always",
7
+ "trailingComma": "all",
8
+ "endOfLine": "lf",
9
+ "plugins": ["prettier-plugin-organize-imports"]
10
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
3
+ "editor.formatOnSave": true,
4
+ "editor.codeActionsOnSave": {
5
+ "source.fixAll.eslint": "explicit",
6
+ "source.organizeImports": "never"
7
+ },
8
+ "[typescript]": {
9
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
10
+ "editor.formatOnSave": true
11
+ },
12
+ "[typescriptreact]": {
13
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
14
+ "editor.formatOnSave": true
15
+ },
16
+ "[javascript]": {
17
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
18
+ "editor.formatOnSave": true
19
+ },
20
+ "[javascriptreact]": {
21
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
22
+ "editor.formatOnSave": true
23
+ },
24
+ "[json]": {
25
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
26
+ "editor.formatOnSave": true
27
+ },
28
+ "[css]": {
29
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
30
+ "editor.formatOnSave": true
31
+ },
32
+ "prettier.configPath": ".prettierrc.json",
33
+ "prettier.requireConfig": true,
34
+ "prettier.ignorePath": ".prettierignore",
35
+ "prettier.documentSelectors": ["**/*.{ts,tsx,js,jsx,json,css,md}"],
36
+ "prettier.enable": true,
37
+ "prettier.useEditorConfig": false,
38
+ "prettier.resolveGlobalModules": false,
39
+ "eslint.format.enable": false,
40
+ "eslint.codeActionsOnSave.mode": "all"
41
+ }
@@ -0,0 +1,57 @@
1
+ # Warlock.js
2
+
3
+ A Blazing fast Nodejs framework to build comprehensive APIs.
4
+
5
+ For more knowledge about Warlock js, please visit Full documentation is in [Official Documentation](https://warlock.js.org).
6
+
7
+ ## Start Development Server
8
+
9
+ To start the development server, run the following command
10
+
11
+ ```bash
12
+ yarn start
13
+ ```
14
+
15
+ OR
16
+
17
+ ```bash
18
+ npm start
19
+ ```
20
+
21
+ ## Build for Production
22
+
23
+ To build the project for production, run the following command
24
+
25
+ ```bash
26
+ yarn build
27
+ ```
28
+
29
+ OR
30
+
31
+ ```bash
32
+ npm run build
33
+ ```
34
+
35
+ ## Start Production Server
36
+
37
+ After building the project, run the following command to start the production server
38
+
39
+ ```bash
40
+ yarn prod
41
+ ```
42
+
43
+ To run it in background, run the following command
44
+
45
+ ```bash
46
+ yarn serve
47
+ ```
48
+
49
+ > Please note that you should have nohup installed on your system to run the server in background
50
+
51
+ ## Tests
52
+
53
+ To run tests, run the following command
54
+
55
+ ```bash
56
+ yarn test
57
+ ```
@@ -0,0 +1,6 @@
1
+ node_modules
2
+ build
3
+ dist
4
+ .env
5
+ .warlock/
6
+ nohup.out