@mimik/mongooser 1.7.0 → 1.8.2
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/.eslintrc +4 -3
- package/index.js +8 -6
- package/package.json +24 -24
- package/Gulpfile.js +0 -33
package/.eslintrc
CHANGED
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
},
|
|
12
12
|
"extends": "airbnb",
|
|
13
13
|
"rules": {
|
|
14
|
-
"import/no-extraneous-dependencies": ["error", {"devDependencies": true}],
|
|
15
|
-
"
|
|
14
|
+
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
|
|
15
|
+
"import/no-unresolved": ["error", { "amd": true, "commonjs": true, "caseSensitiveStrict": true }],
|
|
16
|
+
"brace-style": [1, "stroustrup", { "allowSingleLine": true }],
|
|
16
17
|
"no-confusing-arrow": [0], // arrow isnt confusing
|
|
17
18
|
"max-len": [1, 180, { "ignoreComments": true }],
|
|
18
19
|
"linebreak-style": 0,
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
},
|
|
28
29
|
"settings":{
|
|
29
30
|
"react": {
|
|
30
|
-
"version": "
|
|
31
|
+
"version": "detect"
|
|
31
32
|
}
|
|
32
33
|
},
|
|
33
34
|
"globals": {
|
package/index.js
CHANGED
|
@@ -92,12 +92,14 @@ module.exports = (config) => {
|
|
|
92
92
|
logger.info('creating a database connection', { type, settings: mongoSettingsClone }, correlationId);
|
|
93
93
|
}
|
|
94
94
|
else logger.info('creating a database connection', { type, settings: mongoSettings }, correlationId);
|
|
95
|
-
mongoose.connect(mongoSettings.url, options)
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
mongoose.connect(mongoSettings.url, options)
|
|
96
|
+
.then(() => mongoose)
|
|
97
|
+
.catch((error) => {
|
|
98
|
+
fatal = true;
|
|
99
|
+
logger.error('Fatal error: Could not connect to database', { type, error }, correlationId);
|
|
100
|
+
if (interval) clearInterval(interval);
|
|
101
|
+
logger.flushAndExit(1);
|
|
102
|
+
});
|
|
101
103
|
}
|
|
102
104
|
|
|
103
105
|
mongoose.connection.on('disconnected', () => {
|
package/package.json
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mimik/mongooser",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.2",
|
|
4
4
|
"description": "Helper for setting up mongodb using mongoose for mimik microservices",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=12.0.0"
|
|
8
|
+
},
|
|
6
9
|
"scripts": {
|
|
7
|
-
"lint": "
|
|
8
|
-
"docs": "
|
|
9
|
-
"test": "exit 0",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
10
|
+
"lint": "eslint --ignore-path .gitignore .",
|
|
11
|
+
"docs": "jsdoc2md index.js > README.md",
|
|
12
|
+
"test": "echo \"Error: no test specified\" && exit 0",
|
|
13
|
+
"test-ci": "echo \"Error: no test specified\" && exit 0",
|
|
14
|
+
"prepublishOnly": "npm run docs && npm run lint && npm run test-ci",
|
|
15
|
+
"commit-ready": "npm run docs && npm run lint && npm run test-ci",
|
|
12
16
|
"prepare": "husky install"
|
|
13
17
|
},
|
|
14
18
|
"husky": {
|
|
@@ -22,33 +26,29 @@
|
|
|
22
26
|
"microservice"
|
|
23
27
|
],
|
|
24
28
|
"author": "mimik technology inc <support@mimik.com> (https://developer.mimik.com/)",
|
|
25
|
-
"license": "
|
|
29
|
+
"license": "MIT",
|
|
26
30
|
"repository": {
|
|
27
31
|
"type": "git",
|
|
28
32
|
"url": "https://bitbucket.org/mimiktech/mongooser"
|
|
29
33
|
},
|
|
30
34
|
"dependencies": {
|
|
31
|
-
"@mimik/lib-filters": "^1.4.
|
|
32
|
-
"@mimik/request-helper": "^1.7.
|
|
33
|
-
"@mimik/sumologic-winston-logger": "^1.6.
|
|
35
|
+
"@mimik/lib-filters": "^1.4.4",
|
|
36
|
+
"@mimik/request-helper": "^1.7.5",
|
|
37
|
+
"@mimik/sumologic-winston-logger": "^1.6.8",
|
|
34
38
|
"bluebird": "3.7.2",
|
|
35
39
|
"lodash": "4.17.21",
|
|
36
|
-
"mongoose": "
|
|
40
|
+
"mongoose": "6.3.3"
|
|
37
41
|
},
|
|
38
42
|
"devDependencies": {
|
|
39
|
-
"@mimik/eslint-plugin-dependencies": "^2.4.
|
|
40
|
-
"@mimik/eslint-plugin-document-env": "^1.0.
|
|
41
|
-
"eslint": "8.
|
|
42
|
-
"eslint-config-airbnb": "
|
|
43
|
-
"eslint-plugin-import": "2.
|
|
43
|
+
"@mimik/eslint-plugin-dependencies": "^2.4.3",
|
|
44
|
+
"@mimik/eslint-plugin-document-env": "^1.0.3",
|
|
45
|
+
"eslint": "8.15.0",
|
|
46
|
+
"eslint-config-airbnb": "19.0.4",
|
|
47
|
+
"eslint-plugin-import": "2.26.0",
|
|
44
48
|
"eslint-plugin-jsx-a11y": "6.5.1",
|
|
45
|
-
"eslint-plugin-react": "7.
|
|
46
|
-
"eslint-plugin-react-hooks": "4.
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"gulp-eslint": "6.0.0",
|
|
50
|
-
"gulp-git": "2.10.1",
|
|
51
|
-
"husky": "7.0.4",
|
|
52
|
-
"jsdoc-to-markdown": "7.1.0"
|
|
49
|
+
"eslint-plugin-react": "7.29.4",
|
|
50
|
+
"eslint-plugin-react-hooks": "4.5.0",
|
|
51
|
+
"husky": "8.0.1",
|
|
52
|
+
"jsdoc-to-markdown": "7.1.1"
|
|
53
53
|
}
|
|
54
54
|
}
|
package/Gulpfile.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
//* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
const log = require('fancy-log');
|
|
4
|
-
const gulp = require('gulp');
|
|
5
|
-
const eslint = require('gulp-eslint');
|
|
6
|
-
const git = require('gulp-git');
|
|
7
|
-
const jsdoc2md = require('jsdoc-to-markdown');
|
|
8
|
-
|
|
9
|
-
const files = [
|
|
10
|
-
'index.js',
|
|
11
|
-
'Gulpfile.js',
|
|
12
|
-
'test/**.js',
|
|
13
|
-
'lib/**.js',
|
|
14
|
-
];
|
|
15
|
-
|
|
16
|
-
const createDocs = (done) => {
|
|
17
|
-
jsdoc2md.render({ files: 'index.js' })
|
|
18
|
-
.then((output) => fs.writeFileSync('README.md', output))
|
|
19
|
-
.catch((err) => log.error('docs creation failed:', err.message))
|
|
20
|
-
.finally(() => done());
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const lint = () => gulp.src(files)
|
|
24
|
-
.pipe(eslint({}))
|
|
25
|
-
.pipe(eslint.format());
|
|
26
|
-
|
|
27
|
-
const add = () => gulp.src('README.md')
|
|
28
|
-
.pipe(git.add({ quiet: true }));
|
|
29
|
-
|
|
30
|
-
const docs = gulp.series(createDocs, add);
|
|
31
|
-
|
|
32
|
-
gulp.task('docs', docs);
|
|
33
|
-
gulp.task('lint', lint);
|