@anthonylzq/simba.js 1.6.0 → 1.7.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/CHANGELOG.md +7 -0
- package/README.md +16 -14
- package/lib/index.js +10 -8
- package/lib/src/functions/express.js +2 -2
- package/lib/src/installation.js +6 -6
- package/package.json +1 -1
- package/.eslintrc +0 -64
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [1.7.0](https://github.com/AnthonyLzq/simba.js/compare/v1.6.0...v1.7.0) (2021-12-12)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* updated docs and minor changes ([e6b32ca](https://github.com/AnthonyLzq/simba.js/commit/e6b32ca309603544e3506c9d18717f0e45ef0457))
|
|
11
|
+
|
|
5
12
|
## [1.6.0](https://github.com/AnthonyLzq/simba.js/compare/v1.5.0...v1.6.0) (2021-12-12)
|
|
6
13
|
|
|
7
14
|
|
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Simba.js
|
|
2
2
|
|
|
3
|
+
[](https://standardjs.com)
|
|
4
|
+
|
|
3
5
|
Set up a modern backend app by running one command. This project has the goal to create a complete setup for a backend application using `TypeScript` and `Express`. It will create many files that are usually created manually. Currently the following files are being created:
|
|
4
6
|
|
|
5
7
|
- `.env`
|
|
@@ -59,14 +61,14 @@ simba -h
|
|
|
59
61
|
This will generate the following output:
|
|
60
62
|
|
|
61
63
|
```bash
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
simba [options] (if you it installed globally) or only simba if you want to be
|
|
65
|
+
asked for the options one by one
|
|
64
66
|
|
|
65
67
|
Options:
|
|
66
|
-
-a, --author Author of the project
|
|
67
|
-
-e, --email Email of the author
|
|
68
68
|
-N, --projectName Project name
|
|
69
69
|
-D, --projectDescription Project description
|
|
70
|
+
-a, --author Author of the project
|
|
71
|
+
-e, --email Email of the author
|
|
70
72
|
-H, --heroku Whether or not the project will be deployed using
|
|
71
73
|
Heroku [boolean] [default: false]
|
|
72
74
|
-l, --license Type of license for the project, it can be one of:
|
|
@@ -84,8 +86,8 @@ Options:
|
|
|
84
86
|
-h, --help Show help [boolean]
|
|
85
87
|
|
|
86
88
|
Examples:
|
|
87
|
-
simba
|
|
88
|
-
|
|
89
|
+
simba -N "Project Name" -D "Project description -a Anthony -e
|
|
90
|
+
sluzquinosa@uni.pe"
|
|
89
91
|
|
|
90
92
|
Developed by AnthonyLzq
|
|
91
93
|
```
|
|
@@ -139,28 +141,28 @@ Regardless of the option chosen, a new folder will be generated with the name of
|
|
|
139
141
|
Let's suppose you want to build a project that will be deployed to Heroku, so should run:
|
|
140
142
|
|
|
141
143
|
```bash
|
|
142
|
-
simba -
|
|
144
|
+
simba -N myProject -D 'This is a test' -l mit -a myName -e myEmail@email.com -H
|
|
143
145
|
```
|
|
144
146
|
|
|
145
|
-
Here we are specifying that we want to create a new project called `myProject` using the `MIT` license,
|
|
147
|
+
Here we are specifying that we want to create a new project called `myProject` using the `MIT` license, my name and my email are respectively: `myName` and `myEmail@email.com` and I want to use heroku to deploy this server.
|
|
146
148
|
|
|
147
|
-
As default, `yarn` is selected as package manager, but you don't want to use it,
|
|
149
|
+
As default, `yarn` is selected as package manager, but if you don't want to use it, you can pass the flag `-n` or `--npm` as follows:
|
|
148
150
|
|
|
149
151
|
```bash
|
|
150
|
-
simba -
|
|
152
|
+
simba -N myProject -D 'This is a test' -l mit -a myName -e myEmail@email.com -H -n
|
|
151
153
|
```
|
|
152
154
|
|
|
153
155
|
Finally, you may not want to use a license or one of the available licenses, don't worry, just don't pass the flag `-l` neither `--license` as follows:
|
|
154
156
|
|
|
155
157
|
```bash
|
|
156
|
-
simba -
|
|
158
|
+
simba -N myProject -D 'This is a test' -a myName -e myEmail@email.com -H
|
|
157
159
|
```
|
|
158
160
|
|
|
159
161
|
### Some considerations
|
|
160
162
|
|
|
161
163
|
- This project is based in other project from my own, [`typescript-project-generator`](https://www.npmjs.com/package/typescript-project-generator), but only considering the `express-mongoose-node` part.
|
|
162
|
-
- You are able to run a server that has one main route, `home` (`/`),
|
|
163
|
-
- To connect your server with your `MongoDB` database, you need to provide your `uri` in the `.env`. By default,
|
|
164
|
+
- You are able to run a server that has one main route, `home` (`/`), `user` (`api/user` or `api/user/:userId`) and `docs` (`api/docs`).
|
|
165
|
+
- To connect your server with your `MongoDB` database, you need to provide your `uri` in the `.env`. By default, Simba will try to connect to a local database. The content of the `.env` file is:
|
|
164
166
|
|
|
165
167
|
```bash
|
|
166
168
|
MONGO_URI = mongodb://mongo:mongo@mongo:27017/${projectName}
|
|
@@ -208,8 +210,8 @@ Here is the list of the packages that are being installed, as `devDependencies`:
|
|
|
208
210
|
- [`@typescript-eslint/parser`](https://www.npmjs.com/package/@typescript-eslint/parser)
|
|
209
211
|
- [`dotenv`](https://www.npmjs.com/package/dotenv)
|
|
210
212
|
- [`eslint`](https://www.npmjs.com/package/eslint)
|
|
211
|
-
- [`eslint-config-airbnb-typescript`](https://www.npmjs.com/package/eslint-config-airbnb-typescript)
|
|
212
213
|
- [`eslint-config-prettier`](https://www.npmjs.com/package/eslint-config-prettier)
|
|
214
|
+
- [`eslint-config-standard`](https://www.npmjs.com/package/eslint-config-standard)
|
|
213
215
|
- [`eslint-plugin-import`](https://www.npmjs.com/package/eslint-plugin-import)
|
|
214
216
|
- [`eslint-plugin-prettier`](https://www.npmjs.com/package/eslint-plugin-prettier)
|
|
215
217
|
- [`eslint-plugin-sort-keys-fix`](https://www.npmjs.com/package/eslint-plugin-sort-keys-fix)
|
package/lib/index.js
CHANGED
|
@@ -7,24 +7,25 @@ const installation = require('./src/installation')
|
|
|
7
7
|
const CURRENT_YEAR = `${new Date().getFullYear()}`
|
|
8
8
|
const argv = yargs(hideBin(process.argv))
|
|
9
9
|
.version(false)
|
|
10
|
+
// Pending to test it using npx
|
|
10
11
|
.usage(
|
|
11
|
-
'
|
|
12
|
+
'simba [options] (if you it installed globally) or only simba if you want to be asked for the options one by one'
|
|
12
13
|
)
|
|
13
14
|
.example(
|
|
14
|
-
'simba
|
|
15
|
+
'simba -N "Project Name" -D "Project description -a Anthony -e sluzquinosa@uni.pe"'
|
|
15
16
|
)
|
|
16
|
-
.alias('a', 'author')
|
|
17
|
-
.nargs('a', 1)
|
|
18
|
-
.describe('a', 'Author of the project')
|
|
19
|
-
.alias('e', 'email')
|
|
20
|
-
.nargs('e', 1)
|
|
21
|
-
.describe('e', 'Email of the author')
|
|
22
17
|
.alias('N', 'projectName')
|
|
23
18
|
.nargs('N', 1)
|
|
24
19
|
.describe('N', 'Project name')
|
|
25
20
|
.alias('D', 'projectDescription')
|
|
26
21
|
.nargs('D', 1)
|
|
27
22
|
.describe('D', 'Project description')
|
|
23
|
+
.alias('a', 'author')
|
|
24
|
+
.nargs('a', 1)
|
|
25
|
+
.describe('a', 'Author of the project')
|
|
26
|
+
.alias('e', 'email')
|
|
27
|
+
.nargs('e', 1)
|
|
28
|
+
.describe('e', 'Email of the author')
|
|
28
29
|
.alias('H', 'heroku')
|
|
29
30
|
.describe('H', 'Whether or not the project will be deployed using Heroku')
|
|
30
31
|
.alias('l', 'license')
|
|
@@ -45,6 +46,7 @@ const argv = yargs(hideBin(process.argv))
|
|
|
45
46
|
.nargs('f', 1)
|
|
46
47
|
.describe('f', 'Main file of the project')
|
|
47
48
|
.alias('q', 'questions')
|
|
49
|
+
.nargs('q', 1)
|
|
48
50
|
.describe(
|
|
49
51
|
'q',
|
|
50
52
|
'Whether or not you want to be asked to answer the questions related to the project one by one'
|
package/lib/src/installation.js
CHANGED
|
@@ -58,7 +58,11 @@ module.exports = async ({
|
|
|
58
58
|
|
|
59
59
|
const prodPackages = `${manager} express mongoose morgan http-errors joi swagger-ui-express`
|
|
60
60
|
const devPackages = `${manager} -D \
|
|
61
|
+
@types/express \
|
|
62
|
+
@types/http-errors \
|
|
63
|
+
@types/morgan \
|
|
61
64
|
@types/node \
|
|
65
|
+
@types/swagger-ui-express \
|
|
62
66
|
@typescript-eslint/eslint-plugin \
|
|
63
67
|
@typescript-eslint/parser \
|
|
64
68
|
dotenv \
|
|
@@ -71,17 +75,13 @@ eslint-plugin-sort-keys-fix \
|
|
|
71
75
|
eslint-plugin-typescript-sort-keys \
|
|
72
76
|
nodemon \
|
|
73
77
|
prettier \
|
|
78
|
+
standard-version \
|
|
74
79
|
ts-loader \
|
|
75
80
|
ts-node \
|
|
76
81
|
typescript \
|
|
77
82
|
webpack \
|
|
78
83
|
webpack-cli \
|
|
79
|
-
webpack-node-externals
|
|
80
|
-
@types/express \
|
|
81
|
-
@types/morgan \
|
|
82
|
-
@types/swagger-ui-express \
|
|
83
|
-
@types/http-errors \
|
|
84
|
-
standard-version`
|
|
84
|
+
webpack-node-externals`
|
|
85
85
|
|
|
86
86
|
bar.start(process, i)
|
|
87
87
|
|
package/package.json
CHANGED
package/.eslintrc
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": {
|
|
3
|
-
"node": true
|
|
4
|
-
},
|
|
5
|
-
"root": true,
|
|
6
|
-
"plugins": [
|
|
7
|
-
"import",
|
|
8
|
-
"prettier"
|
|
9
|
-
],
|
|
10
|
-
"extends": [
|
|
11
|
-
"standard",
|
|
12
|
-
"eslint:recommended",
|
|
13
|
-
"prettier"
|
|
14
|
-
],
|
|
15
|
-
"rules": {
|
|
16
|
-
"@typescript-eslint/no-var-requires": "off",
|
|
17
|
-
"arrow-parens": [
|
|
18
|
-
"error",
|
|
19
|
-
"as-needed"
|
|
20
|
-
],
|
|
21
|
-
"import/no-extraneous-dependencies": [
|
|
22
|
-
"error",
|
|
23
|
-
{
|
|
24
|
-
"devDependencies": true
|
|
25
|
-
}
|
|
26
|
-
],
|
|
27
|
-
"max-len": [
|
|
28
|
-
"error",
|
|
29
|
-
{
|
|
30
|
-
"code": 80,
|
|
31
|
-
"ignoreComments": true,
|
|
32
|
-
"ignoreRegExpLiterals": true,
|
|
33
|
-
"ignoreTemplateLiterals": true,
|
|
34
|
-
"ignoreTrailingComments": true,
|
|
35
|
-
"ignoreStrings": true,
|
|
36
|
-
"ignoreUrls": true
|
|
37
|
-
}
|
|
38
|
-
],
|
|
39
|
-
"newline-before-return": "error",
|
|
40
|
-
"object-curly-spacing": [
|
|
41
|
-
"error",
|
|
42
|
-
"always"
|
|
43
|
-
],
|
|
44
|
-
"prefer-const": "error",
|
|
45
|
-
"prettier/prettier": [
|
|
46
|
-
"error",
|
|
47
|
-
{
|
|
48
|
-
"arrowParens": "avoid",
|
|
49
|
-
"bracketSpacing": true,
|
|
50
|
-
"printWidth": 80,
|
|
51
|
-
"quoteProps": "as-needed",
|
|
52
|
-
"semi": false,
|
|
53
|
-
"singleQuote": true,
|
|
54
|
-
"tabWidth": 2,
|
|
55
|
-
"trailingComma": "none"
|
|
56
|
-
}
|
|
57
|
-
],
|
|
58
|
-
"radix": [
|
|
59
|
-
"error",
|
|
60
|
-
"as-needed"
|
|
61
|
-
],
|
|
62
|
-
"spaced-comment": ["error", "always"]
|
|
63
|
-
}
|
|
64
|
-
}
|