@anthonylzq/simba.js 6.2.2 → 7.0.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/lib/index.js +48 -17
- package/lib/src/functions/api/database.js +4 -4
- package/lib/src/functions/api/express.js +1989 -0
- package/lib/src/functions/api/fastify.js +2033 -0
- package/lib/src/functions/api/index.js +36 -140
- package/lib/src/functions/api/services.js +5 -5
- package/lib/src/functions/eslint.js +8 -3
- package/lib/src/functions/ghat.js +2 -1
- package/lib/src/functions/tests.js +20 -15
- package/lib/src/functions/tsconfig.js +7 -2
- package/lib/src/index.js +36 -27
- package/lib/src/utils/constants.js +2 -2
- package/package.json +61 -24
- package/lib/src/functions/api/network.js +0 -2444
package/package.json
CHANGED
|
@@ -1,47 +1,84 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anthonylzq/simba.js",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "set up a modern backend app by running one command",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"service": "node ./bin",
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"build": "npm run
|
|
8
|
+
"service:q": "node ./bin -q",
|
|
9
|
+
"help": "node ./bin -h",
|
|
10
|
+
"lint": "eslint --ext js lib/ --fix",
|
|
11
|
+
"example": "node -r dotenv/config ./bin -N local-example -D 'This is a test using fastify' -a AnthonyLzq -e sluzquinosa@uni.pe -l mit -H --tests --ghat -F",
|
|
12
|
+
"build": "npm run build:express:all && npm run build:fastify:all",
|
|
13
|
+
"build:mongo": "npm run rm:mongo && npm run build:express && npm run build:fastify && npm run build:express:graphql && npm run build:fastify:graphql",
|
|
14
|
+
"build:postgresql": "npm run rm:postgresql && npm run build:express:sequelize && npm run build:fastify:sequelize && npm run build:express:graphql:sequelize && npm run build:fastify:graphql:sequelize",
|
|
15
|
+
"build:rest": "npm run build:express && npm run build:fastify && npm run build:express:sequelize && npm run build:fastify:sequelize",
|
|
16
|
+
"build:graphql": "npm run build:express:graphql && npm run build:fastify:graphql && npm run build:express:graphql:sequelize && npm run build:fastify:graphql:sequelize",
|
|
17
|
+
"build:express:all": "npm run build:express && npm run build:express:graphql && npm run build:express:sequelize && npm run build:express:graphql:sequelize",
|
|
18
|
+
"build:fastify:all": "npm run build:fastify && npm run build:fastify:graphql && npm run build:fastify:sequelize && npm run build:fastify:graphql:sequelize",
|
|
13
19
|
"build:express": "npm run rm:express && npm run cd:mv:example && node -r dotenv/config ./bin -N example/express -D 'This is a test using express' -a AnthonyLzq -e sluzquinosa@uni.pe -l mit -H --tests --ghat && npm run rm:git:express",
|
|
14
20
|
"build:fastify": "npm run rm:fastify && npm run cd:mv:example && node -r dotenv/config ./bin -N example/fastify -D 'This is a test using fastify' -a AnthonyLzq -e sluzquinosa@uni.pe -l mit -H -F --tests --ghat && npm run rm:git:fastify",
|
|
15
21
|
"build:express:graphql": "npm run rm:express:graphql && npm run cd:mv:example && node -r dotenv/config ./bin -N example/express-graphql -D 'This is a test using express with GraphQL' -a AnthonyLzq -e sluzquinosa@uni.pe -l mit -H -g && npm run rm:git:express:graphql",
|
|
16
22
|
"build:fastify:graphql": "npm run rm:fastify:graphql && npm run cd:mv:example && node -r dotenv/config ./bin -N example/fastify-graphql -D 'This is a test using fastify with GraphQL' -a AnthonyLzq -e sluzquinosa@uni.pe -l mit -H -F -g && npm run rm:git:fastify:graphql",
|
|
23
|
+
"build:express:sequelize": "npm run rm:express:sequelize && npm run cd:mv:example && node -r dotenv/config ./bin -N example/express-sequelize -D 'This is a test using express with sequelize' -a AnthonyLzq -e sluzquinosa@uni.pe -l mit -H --tests --ghat -d postgres && npm run rm:git:express:sequelize",
|
|
24
|
+
"build:fastify:sequelize": "npm run rm:fastify:sequelize && npm run cd:mv:example && node -r dotenv/config ./bin -N example/fastify-sequelize -D 'This is a test using fastify with sequelize' -a AnthonyLzq -e sluzquinosa@uni.pe -l mit -H -F --tests --ghat -d postgres && npm run rm:git:fastify:sequelize",
|
|
25
|
+
"build:express:graphql:sequelize": "npm run rm:express:graphql:sequelize && npm run cd:mv:example && node -r dotenv/config ./bin -N example/express-graphql-sequelize -D 'This is a test using express with graphql and sequelize' -a AnthonyLzq -e sluzquinosa@uni.pe -l mit -H -g --tests --ghat -d postgres && npm run rm:git:express:graphql:sequelize",
|
|
26
|
+
"build:fastify:graphql:sequelize": "npm run rm:fastify:graphql:sequelize && npm run cd:mv:example && node -r dotenv/config ./bin -N example/fastify-graphql-sequelize -D 'This is a test using fastify with graphql and sequelize' -a AnthonyLzq -e sluzquinosa@uni.pe -l mit -H -F -g --tests --ghat -d postgres && npm run rm:git:fastify:graphql:sequelize",
|
|
17
27
|
"build:and:test:only": "npm run build && npm run test:only",
|
|
18
|
-
"
|
|
28
|
+
"test": "npm run test:without:restore && git restore .",
|
|
29
|
+
"test:local": "npm run test:without:restore && git restore .",
|
|
30
|
+
"test:without:restore": "npm run build && npm run test:express:local && npm run test:fastify:local && npm run test:express:graphql:local && npm run test:fastify:graphql:local && npm run test:express:sequelize:local && test:fastify:sequelize:local",
|
|
31
|
+
"test:ci:mongo": "npm run build:mongo && npm run test:express:ci && npm run test:fastify:ci && npm run test:express:graphql:ci && npm run test:fastify:graphql:ci",
|
|
32
|
+
"test:ci:postgresql": "npm run build:postgresql && npm run test:express:sequelize:ci && npm run test:fastify:sequelize:ci",
|
|
33
|
+
"test:only": "npm run test:express:only && npm run test:fastify:only",
|
|
34
|
+
"test:express:only": "npm run test:express:local && npm run test:express:graphql:local && npm run test:express:graphql:sequelize:local && npm run test:express:sequelize:local",
|
|
35
|
+
"test:fastify:only": "npm run test:fastify:local && npm run test:fastify:graphql:local && npm run test:fastify:graphql:sequelize:local && npm run test:fastify:graphql:sequelize:local",
|
|
36
|
+
"test:express:local": "if [ -d \"example/express/node_modules\" ]; then npm run test:local --prefix example/express; else echo 'Can not run the test for express api because the dependencies are not installed'; fi",
|
|
37
|
+
"test:fastify:local": "if [ -d \"example/fastify/node_modules\" ]; then npm run test:local --prefix example/fastify; else echo 'Can not run the test for fastify api because the dependencies are not installed'; fi",
|
|
38
|
+
"test:express:graphql:local": "if [ -d \"example/express-graphql/node_modules\" ]; then npm run test:local --prefix example/express-graphql; else echo 'Can not run the test for express api because the dependencies are not installed'; fi",
|
|
39
|
+
"test:fastify:graphql:local": "if [ -d \"example/fastify-graphql/node_modules\" ]; then npm run test:local --prefix example/fastify-graphql; else echo 'Can not run the test for fastify-graphql api because the dependencies are not installed'; fi",
|
|
40
|
+
"test:express:sequelize:local": "if [ -d \"example/express-sequelize/node_modules\" ]; then npm run test:local --prefix example/express-sequelize; else echo 'Can not run the test for express-sequelize api because the dependencies are not installed'; fi",
|
|
41
|
+
"test:fastify:sequelize:local": "if [ -d \"example/fastify-sequelize/node_modules\" ]; then npm run test:local --prefix example/fastify-sequelize; else echo 'Can not run the test for fastify-sequelize api because the dependencies are not installed'; fi",
|
|
42
|
+
"test:express:graphql:sequelize:local": "if [ -d \"example/express-graphql-sequelize/node_modules\" ]; then npm run test:local --prefix example/express-graphql-sequelize; else echo 'Can not run the test for express-graphql-sequelize api because the dependencies are not installed'; fi",
|
|
43
|
+
"test:fastify:graphql:sequelize:local": "if [ -d \"example/fastify-graphql-sequelize/node_modules\" ]; then npm run test:local --prefix example/fastify-graphql-sequelize; else echo 'Can not run the test for fastify-graphql-sequelize api because the dependencies are not installed'; fi",
|
|
44
|
+
"test:express:ci": "if [ -d \"example/express/node_modules\" ]; then npm run test:ci --prefix example/express; else echo 'Can not run the test for express api because the dependencies are not installed'; fi",
|
|
45
|
+
"test:fastify:ci": "if [ -d \"example/fastify/node_modules\" ]; then npm run test:ci --prefix example/fastify; else echo 'Can not run the test for fastify api because the dependencies are not installed'; fi",
|
|
46
|
+
"test:express:graphql:ci": "if [ -d \"example/express-graphql/node_modules\" ]; then npm run test:ci --prefix example/express-graphql; else echo 'Can not run the test for express api because the dependencies are not installed'; fi",
|
|
47
|
+
"test:fastify:graphql:ci": "if [ -d \"example/fastify-graphql/node_modules\" ]; then npm run test:ci --prefix example/fastify-graphql; else echo 'Can not run the test for fastify api because the dependencies are not installed'; fi",
|
|
48
|
+
"test:express:sequelize:ci": "if [ -d \"example/express-sequelize/node_modules\" ]; then npm run test:ci --prefix example/express-sequelize; else echo 'Can not run the test for express api because the dependencies are not installed'; fi",
|
|
49
|
+
"test:fastify:sequelize:ci": "if [ -d \"example/fastify-sequelize/node_modules\" ]; then npm run test:ci --prefix example/fastify-sequelize; else echo 'Can not run the test for fastify api because the dependencies are not installed'; fi",
|
|
50
|
+
"test:express:graphql:sequelize:ci": "if [ -d \"example/express-graphql-sequelize/node_modules\" ]; then npm run test:ci --prefix example/express-graphql-sequelize; else echo 'Can not run the test for express api because the dependencies are not installed'; fi",
|
|
51
|
+
"test:fastify:graphql:sequelize:ci": "if [ -d \"example/fastify-graphql-sequelize/node_modules\" ]; then npm run test:ci --prefix example/fastify-graphql-sequelize; else echo 'Can not run the test for fastify api because the dependencies are not installed'; fi",
|
|
52
|
+
"list:directory:tree:express": "if [ -f \"projectStructureExamples/express.txt\" ]; then rm projectStructureExamples/express.txt; fi && tree example/express -a --dirsfirst --sort name -I node_modules | cut -d'/' -f 2 | tail -n +2 >> projectStructureExamples/express.txt",
|
|
53
|
+
"list:directory:tree:fastify": "if [ -f \"projectStructureExamples/fastify.txt\" ]; then rm projectStructureExamples/fastify.txt; fi && tree example/fastify -a --dirsfirst --sort name -I node_modules | cut -d'/' -f 2 | tail -n +2 >> projectStructureExamples/fastify.txt",
|
|
54
|
+
"list:directory:tree:express-graphql": "if [ -f \"projectStructureExamples/express-graphql.txt\" ]; then rm projectStructureExamples/express-graphql.txt; fi && tree example/express-graphql -a --dirsfirst --sort name -I node_modules | cut -d'/' -f 2 | tail -n +2 >> projectStructureExamples/express-graphql.txt",
|
|
55
|
+
"list:directory:tree:fastify-graphql": "if [ -f \"projectStructureExamples/fastify-graphql.txt\" ]; then rm projectStructureExamples/fastify-graphql.txt; fi && tree example/fastify-graphql -a --dirsfirst --sort name -I node_modules | cut -d'/' -f 2 | tail -n +2 >> projectStructureExamples/fastify-graphql.txt",
|
|
56
|
+
"list:directory:tree:express-sequelize": "if [ -f \"projectStructureExamples/express-sequelize.txt\" ]; then rm projectStructureExamples/express-sequelize.txt; fi && tree example/express-sequelize -a --dirsfirst --sort name -I node_modules | cut -d'/' -f 2 | tail -n +2 >> projectStructureExamples/express-sequelize.txt",
|
|
57
|
+
"list:directory:tree:fastify-sequelize": "if [ -f \"projectStructureExamples/fastify-sequelize.txt\" ]; then rm projectStructureExamples/fastify-sequelize.txt; fi && tree example/fastify-sequelize -a --dirsfirst --sort name -I node_modules | cut -d'/' -f 2 | tail -n +2 >> projectStructureExamples/fastify-sequelize.txt",
|
|
58
|
+
"list:directory:tree:examples": "npm run list:directory:tree:express && npm run list:directory:tree:fastify && npm run list:directory:tree:express-graphql && npm run list:directory:tree:fastify-graphql && npm run list:directory:tree:express-sequelize && npm run list:directory:tree:fastify-sequelize",
|
|
19
59
|
"rm": "if [ -d \"example\" ]; then rm -rf example; fi",
|
|
60
|
+
"rm:mongo": "if [ -d \"example/express\" ]; then rm -rf example/express; fi && if [ -d \"example/express-graphql\" ]; then rm -rf example/express-graphql; fi && if [ -d \"example/fastify\" ]; then rm -rf example/fastify; fi && if [ -d \"example/fastify-graphql\" ]; then rm -rf example/fastify-graphql; fi",
|
|
61
|
+
"rm:postgresql": "if [ -d \"example/express-sequelize\" ]; then rm -rf example/express-sequelize; fi && if [ -d \"example/fastify-sequelize\" ]; then rm -rf example/fastify-sequelize; fi",
|
|
20
62
|
"rm:express": "if [ -d \"example/express\" ]; then rm -rf example/express; fi",
|
|
21
63
|
"rm:fastify": "if [ -d \"example/fastify\" ]; then rm -rf example/fastify; fi",
|
|
22
64
|
"rm:express:graphql": "if [ -d \"example/express-graphql\" ]; then rm -rf example/express-graphql; fi",
|
|
23
65
|
"rm:fastify:graphql": "if [ -d \"example/fastify-graphql\" ]; then rm -rf example/fastify-graphql; fi",
|
|
66
|
+
"rm:express:sequelize": "if [ -d \"example/express-sequelize\" ]; then rm -rf example/express-sequelize; fi",
|
|
67
|
+
"rm:fastify:sequelize": "if [ -d \"example/fastify-sequelize\" ]; then rm -rf example/fastify-sequelize; fi",
|
|
68
|
+
"rm:express:graphql:sequelize": "if [ -d \"example/express-graphql-sequelize\" ]; then rm -rf example/express-graphql-sequelize; fi",
|
|
69
|
+
"rm:fastify:graphql:sequelize": "if [ -d \"example/fastify-graphql-sequelize\" ]; then rm -rf example/fastify-graphql-sequelize; fi",
|
|
24
70
|
"rm:git:express": "if [ -d \"example/express/.git\" ]; then rm -rf example/express/.git; fi",
|
|
25
71
|
"rm:git:fastify": "if [ -d \"example/fastify/.git\" ]; then rm -rf example/fastify/.git; fi",
|
|
26
72
|
"rm:git:express:graphql": "if [ -d \"example/express-graphql/.git\" ]; then rm -rf example/express-graphql/.git; fi",
|
|
27
73
|
"rm:git:fastify:graphql": "if [ -d \"example/fastify-graphql/.git\" ]; then rm -rf example/fastify-graphql/.git; fi",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"test:fastify:ci": "if [ -d \"example/fastify/node_modules\" ]; then npm run test:ci --prefix example/fastify; else echo 'Can not run the test for fastify api because the dependencies are not installed'; fi",
|
|
34
|
-
"test:express:graphql:ci": "if [ -d \"example/express-graphql/node_modules\" ]; then npm run test:ci --prefix example/express-graphql; else echo 'Can not run the test for express api because the dependencies are not installed'; fi",
|
|
35
|
-
"test:fastify:graphql:ci": "if [ -d \"example/fastify-graphql/node_modules\" ]; then npm run test:ci --prefix example/fastify-graphql; else echo 'Can not run the test for fastify api because the dependencies are not installed'; fi",
|
|
74
|
+
"rm:git:express:sequelize": "if [ -d \"example/express-sequelize/.git\" ]; then rm -rf example/express-sequelize/.git; fi",
|
|
75
|
+
"rm:git:fastify:sequelize": "if [ -d \"example/fastify-sequelize/.git\" ]; then rm -rf example/fastify-sequelize/.git; fi",
|
|
76
|
+
"rm:git:express:graphql:sequelize": "if [ -d \"example/express-graphql-sequelize/.git\" ]; then rm -rf example/express-graphql-sequelize/.git; fi",
|
|
77
|
+
"rm:git:fastify:graphql:sequelize": "if [ -d \"example/fastify-graphql-sequelize/.git\" ]; then rm -rf example/fastify-graphql-sequelize/.git; fi",
|
|
78
|
+
"rm:node_modules": "if [ -d \"example/express/node_modules\" ]; then rm -rf example/express/node_modules; fi && if [ -d \"example/express-graphql/node_modules\" ]; then rm -rf example/express-graphql/node_modules; fi && if [ -d \"example/fastify/node_modules\" ]; then rm -rf example/fastify/node_modules; fi && if [ -d \"example/fastify-graphql/node_modules\" ]; then rm -rf example/fastify-graphql/node_modules; fi",
|
|
36
79
|
"cd:mv:example": "if [ ! -d \"example\" ]; then mkdir example && cd example; fi",
|
|
37
80
|
"release": "standard-version",
|
|
38
|
-
"version": "npm run release && npm run list:directory:tree:examples && git add ."
|
|
39
|
-
"remove:node_modules": "if [ -d \"example/express/node_modules\" ]; then rm -rf example/express/node_modules; fi && if [ -d \"example/express-graphql/node_modules\" ]; then rm -rf example/express-graphql/node_modules; fi && if [ -d \"example/fastify/node_modules\" ]; then rm -rf example/fastify/node_modules; fi && if [ -d \"example/fastify-graphql/node_modules\" ]; then rm -rf example/fastify-graphql/node_modules; fi",
|
|
40
|
-
"list:directory:tree:express": "npm run remove:node_modules && if [ -f \"projectStructureExamples/express.txt\" ]; then rm projectStructureExamples/express.txt; fi && tree example/express -a --dirsfirst --sort name -I node_modules | cut -d'/' -f 2 | head -n -2 >> projectStructureExamples/express.txt",
|
|
41
|
-
"list:directory:tree:express-graphql": "npm run remove:node_modules && if [ -f \"projectStructureExamples/express-graphql.txt\" ]; then rm projectStructureExamples/express-graphql.txt; fi && tree example/express -a --dirsfirst --sort name -I node_modules | cut -d'/' -f 2 | head -n -2 >> projectStructureExamples/express-graphql.txt",
|
|
42
|
-
"list:directory:tree:fastify": "npm run remove:node_modules && if [ -f \"projectStructureExamples/fastify.txt\" ]; then rm projectStructureExamples/fastify.txt; fi && tree example/express -a --dirsfirst --sort name -I node_modules | cut -d'/' -f 2 | head -n -2 >> projectStructureExamples/fastify.txt",
|
|
43
|
-
"list:directory:tree:fastify-graphql": "npm run remove:node_modules && if [ -f \"projectStructureExamples/fastify-graphql.txt\" ]; then rm projectStructureExamples/fastify-graphql.txt; fi && tree example/express -a --dirsfirst --sort name -I node_modules | cut -d'/' -f 2 | head -n -2 >> projectStructureExamples/fastify-graphql.txt",
|
|
44
|
-
"list:directory:tree:examples": "npm run list:directory:tree:express && npm run list:directory:tree:express-graphql && npm run list:directory:tree:fastify && npm run list:directory:tree:fastify-graphql"
|
|
81
|
+
"version": "npm run release && npm run list:directory:tree:examples && git add ."
|
|
45
82
|
},
|
|
46
83
|
"bin": {
|
|
47
84
|
"simba": "./bin/index.js"
|
|
@@ -67,12 +104,12 @@
|
|
|
67
104
|
},
|
|
68
105
|
"devDependencies": {
|
|
69
106
|
"dotenv": "^16.0.1",
|
|
70
|
-
"eslint": "^8.
|
|
107
|
+
"eslint": "^8.19.0",
|
|
71
108
|
"eslint-config-prettier": "^8.5.0",
|
|
72
109
|
"eslint-config-standard": "^17.0.0",
|
|
73
110
|
"eslint-plugin-import": "^2.26.0",
|
|
74
111
|
"eslint-plugin-node": "^11.1.0",
|
|
75
|
-
"eslint-plugin-prettier": "^4.
|
|
112
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
76
113
|
"eslint-plugin-promise": "^6.0.0",
|
|
77
114
|
"prettier": "^2.7.1",
|
|
78
115
|
"standard-version": "^9.5.0"
|