@anthonylzq/simba.js 3.2.0 → 4.3.0
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 +25 -13
- package/lib/index.js +0 -2
- package/lib/src/functions/api.js +377 -344
- package/lib/src/functions/tsconfig.js +1 -1
- package/lib/src/index.js +4 -4
- package/lib/src/utils/titleCase.js +1 -1
- package/package.json +8 -6
package/README.md
CHANGED
|
@@ -136,9 +136,8 @@ Regardless of the option chosen, a new folder will be generated with the name of
|
|
|
136
136
|
┃ ┗ 📜index.ts
|
|
137
137
|
┣ 📂network
|
|
138
138
|
┃ ┣ 📂routes
|
|
139
|
-
┃ ┃ ┣ 📂
|
|
140
|
-
┃ ┃ ┃
|
|
141
|
-
┃ ┃ ┃ ┗ 📜user.ts
|
|
139
|
+
┃ ┃ ┣ 📂utils
|
|
140
|
+
┃ ┃ ┃ ┗ 📜docs.ts
|
|
142
141
|
┃ ┃ ┣ 📜home.ts
|
|
143
142
|
┃ ┃ ┣ 📜index.ts
|
|
144
143
|
┃ ┃ ┗ 📜user.ts
|
|
@@ -146,6 +145,9 @@ Regardless of the option chosen, a new folder will be generated with the name of
|
|
|
146
145
|
┃ ┣ 📜response.ts
|
|
147
146
|
┃ ┣ 📜routes.ts
|
|
148
147
|
┃ ┗ 📜server.ts
|
|
148
|
+
┣ 📂schemas
|
|
149
|
+
┃ ┣ 📜index.ts
|
|
150
|
+
┃ ┗ 📜user.ts
|
|
149
151
|
┣ 📂services
|
|
150
152
|
┃ ┣ 📂utils
|
|
151
153
|
┃ ┃ ┣ 📂messages
|
|
@@ -183,8 +185,6 @@ Regardless of the option chosen, a new folder will be generated with the name of
|
|
|
183
185
|
📂node_modules
|
|
184
186
|
📂src
|
|
185
187
|
┣ 📂@types
|
|
186
|
-
┃ ┣ 📂dto
|
|
187
|
-
┃ ┃ ┗ 📜user.d.ts
|
|
188
188
|
┃ ┣ 📂models
|
|
189
189
|
┃ ┃ ┗ 📜user.d.ts
|
|
190
190
|
┃ ┗ 📜index.d.ts
|
|
@@ -200,9 +200,8 @@ Regardless of the option chosen, a new folder will be generated with the name of
|
|
|
200
200
|
┃ ┗ 📜index.ts
|
|
201
201
|
┣ 📂network
|
|
202
202
|
┃ ┣ 📂routes
|
|
203
|
-
┃ ┃ ┣ 📂
|
|
204
|
-
┃ ┃ ┃
|
|
205
|
-
┃ ┃ ┃ ┗ 📜user.ts
|
|
203
|
+
┃ ┃ ┣ 📂utils
|
|
204
|
+
┃ ┃ ┃ ┗ 📜docs.ts
|
|
206
205
|
┃ ┃ ┣ 📜docs.ts
|
|
207
206
|
┃ ┃ ┣ 📜home.ts
|
|
208
207
|
┃ ┃ ┣ 📜index.ts
|
|
@@ -211,6 +210,9 @@ Regardless of the option chosen, a new folder will be generated with the name of
|
|
|
211
210
|
┃ ┣ 📜response.ts
|
|
212
211
|
┃ ┣ 📜routes.ts
|
|
213
212
|
┃ ┗ 📜server.ts
|
|
213
|
+
┣ 📂schemas
|
|
214
|
+
┃ ┣ 📜index.ts
|
|
215
|
+
┃ ┗ 📜user.ts
|
|
214
216
|
┣ 📂services
|
|
215
217
|
┃ ┣ 📂utils
|
|
216
218
|
┃ ┃ ┣ 📂messages
|
|
@@ -271,7 +273,7 @@ If you want to check the content of the files, please check the [example](https:
|
|
|
271
273
|
|
|
272
274
|
- The provided project structure is inspired in my personal experience as [`Node.js`](https://nodejs.org/en/) developer and the [`Nest`](https://nestjs.com/) framework. It follows a layered architecture:
|
|
273
275
|
|
|
274
|
-
1. Presentation layer (network layer): it is represented by the network
|
|
276
|
+
1. Presentation layer (network layer): it is represented by the network and schemas folders, which contains the routes and the schemas necessary for each route.
|
|
275
277
|
2. Business layer (services layer): it is represented by the services folder, which contains all the code related to the business logic of your application.
|
|
276
278
|
3. Persistance layer (database layer): it is represented by the database folder, which contains the database connection, models and queries (that will be used by the services). Multiple database connection are possible and should be implemented here.
|
|
277
279
|
|
|
@@ -284,7 +286,14 @@ If you want to check the content of the files, please check the [example](https:
|
|
|
284
286
|
|
|
285
287
|
## What is new?
|
|
286
288
|
|
|
287
|
-
Please check the [`changelog.md`](https://github.com/AnthonyLzq/simba.js/blob/master/CHANGELOG.md) file. Also, if you want to check what is coming, check the [road map](https://simbajs.notion.site/simbajs/783092dc7d444067b4c56a25d671f658?v=31060f3d17524ca58870e86c2960a6df).
|
|
289
|
+
Please check the [`changelog.md`](https://github.com/AnthonyLzq/simba.js/blob/master/CHANGELOG.md) file. Also, if you want to check what is coming, check the [road map](https://simbajs.notion.site/simbajs/783092dc7d444067b4c56a25d671f658?v=31060f3d17524ca58870e86c2960a6df).
|
|
290
|
+
|
|
291
|
+
### Version 4.x.x
|
|
292
|
+
|
|
293
|
+
In this major version I would be focusing on adding new possible configurations according to the road map. The major changes of this version will be described here:
|
|
294
|
+
|
|
295
|
+
- Replaced [`joi`](https://www.npmjs.com/package/joi) in favor of [`ajv`](https://www.npmjs.com/package/ajv) + [`@sinclair/typebox`](https://www.npmjs.com/package/@sinclair/typebox) in the Express case. [Why did I do this?](https://simbajs.notion.site/TypeBox-support-for-Express-f4e3cf8dd06f4c7ba4d8e4051a52688c)
|
|
296
|
+
- Using more descriptive nouns, now every database object is represented with a DBO at the end, like: _UserDBO_. Also the objects that are sent and received will have a DTO at the end, like: _UserDTO_.
|
|
288
297
|
|
|
289
298
|
## <a name="notes"></a>Notes
|
|
290
299
|
|
|
@@ -314,6 +323,8 @@ Here is the list of the packages that are being installed, as `devDependencies`:
|
|
|
314
323
|
|
|
315
324
|
As `dependencies`:
|
|
316
325
|
|
|
326
|
+
- [`@sinclair/typebox`](https://www.npmjs.com/package/@sinclair/typebox)
|
|
327
|
+
- [`ajv`](https://www.npmjs.com/package/ajv)
|
|
317
328
|
- [`http-errors`](https://www.npmjs.com/package/http-errors)
|
|
318
329
|
- [`mongoose`](https://mongoosejs.com/)
|
|
319
330
|
|
|
@@ -322,13 +333,14 @@ As `dependencies`:
|
|
|
322
333
|
As `devDependencies`:
|
|
323
334
|
|
|
324
335
|
- [`@types/express`](https://www.npmjs.com/package/@types/express)
|
|
336
|
+
- [`@types/cors`](https://www.npmjs.com/package/@types/cors)
|
|
325
337
|
- [`@types/morgan`](https://www.npmjs.com/package/@types/morgan)
|
|
326
338
|
- [`@types/swagger-ui-express`](https://www.npmjs.com/package/@types/swagger-ui-express)
|
|
327
339
|
|
|
328
340
|
As `dependencies`:
|
|
329
341
|
|
|
330
|
-
- [`
|
|
331
|
-
- [`
|
|
342
|
+
- [`cors`](https://www.npmjs.com/package/cors)
|
|
343
|
+
- [`express`](https://www.npmjs.com/package/express)
|
|
332
344
|
- [`morgan`](https://www.npmjs.com/package/morgan)
|
|
333
345
|
- [`swagger-ui-express`](https://www.npmjs.com/package/swagger-ui-express)
|
|
334
346
|
|
|
@@ -336,8 +348,8 @@ As `dependencies`:
|
|
|
336
348
|
|
|
337
349
|
As `dependencies`:
|
|
338
350
|
|
|
339
|
-
- [`@sinclair/typebox`](https://www.npmjs.com/package/@sinclair/typebox)
|
|
340
351
|
- [`fastify`](https://www.npmjs.com/package/fastify)
|
|
352
|
+
- [`fastify-cors`](https://www.npmjs.com/package/fastify-cors)
|
|
341
353
|
- [`fastify-swagger`](https://www.npmjs.com/package/fastify-swagger)
|
|
342
354
|
|
|
343
355
|
Feel free to contribute to this project. Every contribution will be appreciated.
|