@anthonylzq/simba.js 2.0.0 → 2.0.4
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 +4 -5
- package/lib/index.js +1 -1
- package/lib/src/functions/eslint.js +49 -49
- package/lib/src/functions/express.js +9 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ Set up a modern backend app by running one command. This project has the goal to
|
|
|
25
25
|
This package is meant to be installed globally in your computer by using:
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
npm i -g simba.js
|
|
28
|
+
npm i -g @anthonylzq/simba.js
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
## Usage
|
|
@@ -88,8 +88,8 @@ Options:
|
|
|
88
88
|
-h, --help Show help [boolean]
|
|
89
89
|
|
|
90
90
|
Examples:
|
|
91
|
-
simba
|
|
92
|
-
sluzquinosa@uni.pe
|
|
91
|
+
simba -N 'Project Name' -D 'Project description' -a Anthony -e
|
|
92
|
+
sluzquinosa@uni.pe
|
|
93
93
|
|
|
94
94
|
Developed by AnthonyLzq
|
|
95
95
|
```
|
|
@@ -138,8 +138,6 @@ Regardless of the option chosen, a new folder will be generated with the name of
|
|
|
138
138
|
┃ ┃ ┗ 📜index.ts
|
|
139
139
|
┃ ┣ 📜index.ts
|
|
140
140
|
┃ ┗ 📜user.ts
|
|
141
|
-
┣ 📂test
|
|
142
|
-
┃ ┗ 📜test.http
|
|
143
141
|
┣ 📂utils
|
|
144
142
|
┃ ┣ 📜docs.json
|
|
145
143
|
┃ ┗ 📜index.ts
|
|
@@ -155,6 +153,7 @@ Regardless of the option chosen, a new folder will be generated with the name of
|
|
|
155
153
|
📜nodemon.json
|
|
156
154
|
📜package.json
|
|
157
155
|
📜README.md
|
|
156
|
+
📜index.http
|
|
158
157
|
📜tsconfig.base.json
|
|
159
158
|
📜tsconfig.json
|
|
160
159
|
📜webpack.config.js
|
package/lib/index.js
CHANGED
|
@@ -12,7 +12,7 @@ const argv = yargs(hideBin(process.argv))
|
|
|
12
12
|
'simba [options] (if you it installed globally) or only simba if you want to be asked for the options one by one'
|
|
13
13
|
)
|
|
14
14
|
.example(
|
|
15
|
-
|
|
15
|
+
"simba -N 'Project Name' -D 'Project description' -a Anthony -e sluzquinosa@uni.pe"
|
|
16
16
|
)
|
|
17
17
|
.alias('N', 'projectName')
|
|
18
18
|
.nargs('N', 1)
|
|
@@ -6,71 +6,71 @@ const writeFile = require('../utils/writeFile')
|
|
|
6
6
|
*/
|
|
7
7
|
module.exports = async projectName => {
|
|
8
8
|
const data = {
|
|
9
|
-
eslintContent: `
|
|
10
|
-
env: {
|
|
11
|
-
node: true
|
|
9
|
+
eslintContent: `{
|
|
10
|
+
"env": {
|
|
11
|
+
"node": true
|
|
12
12
|
},
|
|
13
|
-
root: true,
|
|
14
|
-
parser:
|
|
15
|
-
plugins: [
|
|
16
|
-
extends: [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
"root": true,
|
|
14
|
+
"parser": "@typescript-eslint/parser",
|
|
15
|
+
"plugins": ["@typescript-eslint", "import", "prettier"],
|
|
16
|
+
"extends": [
|
|
17
|
+
"standard",
|
|
18
|
+
"eslint:recommended",
|
|
19
|
+
"plugin:@typescript-eslint/eslint-recommended",
|
|
20
|
+
"plugin:@typescript-eslint/recommended",
|
|
21
|
+
"prettier"
|
|
22
22
|
],
|
|
23
|
-
rules: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
"rules": {
|
|
24
|
+
"@typescript-eslint/no-var-requires": "off",
|
|
25
|
+
"@typescript-eslint/no-empty-interface": "off",
|
|
26
|
+
"arrow-parens": ["error", "as-needed"],
|
|
27
|
+
"import/extensions": [
|
|
28
28
|
2,
|
|
29
29
|
{
|
|
30
|
-
ts:
|
|
31
|
-
js:
|
|
32
|
-
json:
|
|
30
|
+
"ts": "never",
|
|
31
|
+
"js": "always",
|
|
32
|
+
"json": "always"
|
|
33
33
|
}
|
|
34
34
|
],
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
"import/no-extraneous-dependencies": [
|
|
36
|
+
"error",
|
|
37
37
|
{
|
|
38
|
-
devDependencies: [
|
|
39
|
-
optionalDependencies: [
|
|
40
|
-
peerDependencies: [
|
|
38
|
+
"devDependencies": ["**/*.test.js", "webpack.config.js"],
|
|
39
|
+
"optionalDependencies": ["**/*.test.js"],
|
|
40
|
+
"peerDependencies": ["**/*.test.js"]
|
|
41
41
|
}
|
|
42
42
|
],
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
"max-len": [
|
|
44
|
+
"error",
|
|
45
45
|
{
|
|
46
|
-
code: 80,
|
|
47
|
-
ignoreComments: true,
|
|
48
|
-
ignoreRegExpLiterals: true,
|
|
49
|
-
ignoreTemplateLiterals: true,
|
|
50
|
-
ignoreTrailingComments: true,
|
|
51
|
-
ignoreStrings: true,
|
|
52
|
-
ignoreUrls: true
|
|
46
|
+
"code": 80,
|
|
47
|
+
"ignoreComments": true,
|
|
48
|
+
"ignoreRegExpLiterals": true,
|
|
49
|
+
"ignoreTemplateLiterals": true,
|
|
50
|
+
"ignoreTrailingComments": true,
|
|
51
|
+
"ignoreStrings": true,
|
|
52
|
+
"ignoreUrls": true
|
|
53
53
|
}
|
|
54
54
|
],
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
"newline-before-return": "error",
|
|
56
|
+
"object-curly-spacing": ["error", "always"],
|
|
57
57
|
"object-shorthand": ["error", "always"],
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
"prefer-const": "error",
|
|
59
|
+
"prettier/prettier": [
|
|
60
|
+
"error",
|
|
61
61
|
{
|
|
62
|
-
arrowParens:
|
|
63
|
-
bracketSpacing: true,
|
|
64
|
-
printWidth: 80,
|
|
65
|
-
quoteProps:
|
|
66
|
-
semi: false,
|
|
67
|
-
singleQuote: true,
|
|
68
|
-
tabWidth: 2,
|
|
69
|
-
trailingComma:
|
|
62
|
+
"arrowParens": "avoid",
|
|
63
|
+
"bracketSpacing": true,
|
|
64
|
+
"printWidth": 80,
|
|
65
|
+
"quoteProps": "as-needed",
|
|
66
|
+
"semi": false,
|
|
67
|
+
"singleQuote": true,
|
|
68
|
+
"tabWidth": 2,
|
|
69
|
+
"trailingComma": "none"
|
|
70
70
|
}
|
|
71
71
|
],
|
|
72
|
-
radix: [
|
|
73
|
-
|
|
72
|
+
"radix": ["error", "as-needed"],
|
|
73
|
+
"spaced-comment": ["error", "always"]
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
`,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const os = require('os')
|
|
1
2
|
const util = require('util')
|
|
2
3
|
const exec = util.promisify(require('child_process').exec)
|
|
3
4
|
const writeFile = require('../utils/writeFile')
|
|
@@ -40,13 +41,12 @@ const writeFile = require('../utils/writeFile')
|
|
|
40
41
|
* | | |- index: content, file
|
|
41
42
|
* | |- user: content, file
|
|
42
43
|
* | |- index: content, file
|
|
43
|
-
* |- test:
|
|
44
|
-
* | |- index.http: content, file
|
|
45
44
|
* |- utils:
|
|
46
45
|
* | |- docs.json: content, file
|
|
47
46
|
* | |- index: content, file
|
|
48
47
|
* |- .env: content, file
|
|
49
48
|
* |- index: content, file
|
|
49
|
+
* index.http: content, file
|
|
50
50
|
*/
|
|
51
51
|
|
|
52
52
|
/**
|
|
@@ -777,7 +777,7 @@ Content-Type: application/json
|
|
|
777
777
|
### Testing delete user
|
|
778
778
|
DELETE http://localhost:1996/api/user/60e7e3b93b01c1a7aa74cd6b
|
|
779
779
|
`,
|
|
780
|
-
file: `${projectName}/
|
|
780
|
+
file: `${projectName}/index.http`
|
|
781
781
|
}
|
|
782
782
|
},
|
|
783
783
|
utils: {
|
|
@@ -1219,7 +1219,7 @@ Server.start()
|
|
|
1219
1219
|
}
|
|
1220
1220
|
}
|
|
1221
1221
|
|
|
1222
|
-
|
|
1222
|
+
const createFoldersCommands = `mkdir ${projectName}/src \
|
|
1223
1223
|
${projectName}/src/@types \
|
|
1224
1224
|
${projectName}/src/@types/dto \
|
|
1225
1225
|
${projectName}/src/@types/custom \
|
|
@@ -1236,7 +1236,11 @@ ${projectName}/src/network/routes \
|
|
|
1236
1236
|
${projectName}/src/network/routes/schemas \
|
|
1237
1237
|
${projectName}/src/test \
|
|
1238
1238
|
${projectName}/src/utils
|
|
1239
|
-
`
|
|
1239
|
+
`
|
|
1240
|
+
|
|
1241
|
+
if (os.platform() === 'win32')
|
|
1242
|
+
await exec(createFoldersCommands.replaceAll('/', '\\'))
|
|
1243
|
+
else await exec(createFoldersCommands)
|
|
1240
1244
|
|
|
1241
1245
|
// /@types
|
|
1242
1246
|
await writeFile(data['@types'].index.file, data['@types'].index.content)
|