Skip to content

Commit

Permalink
deps(mongoose): upgrade to 8.1.0
Browse files Browse the repository at this point in the history
also typegoose to 12.1.0
  • Loading branch information
hasezoey committed Jan 17, 2024
1 parent fc25ffd commit 8c66032
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ I started `@typegoose/auto-increment` because `mongoose-auto-increment` and `mon

- Node 16.20.1+
- TypeScript 5.3+ (older versions could work, but are not tested)
- mongoose 8.0.1+
- mongoose 8.1.0+

## Install

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"contributors": [],
"license": "MIT",
"peerDependencies": {
"mongoose": "~8.0.1"
"mongoose": "~8.1.0"
},
"devDependencies": {
"@commitlint/cli": "^17.8.1",
Expand All @@ -41,7 +41,7 @@
"@semantic-release/github": "^8.1.0",
"@semantic-release/npm": "^9.0.2",
"@semantic-release/release-notes-generator": "^10.0.3",
"@typegoose/typegoose": "~12.0.0",
"@typegoose/typegoose": "~12.1.0",
"@types/jest": "^29.5.11",
"@types/node": "~16.11.7",
"@typescript-eslint/eslint-plugin": "^6.19.0",
Expand All @@ -54,7 +54,7 @@
"jest": "^29.7.0",
"lint-staged": "^14.0.1",
"mongodb-memory-server": "^9.1.5",
"mongoose": "~8.0.1",
"mongoose": "~8.1.0",
"prettier": "^3.2.4",
"rimraf": "5.0.5",
"semantic-release": "^19.0.5",
Expand Down
4 changes: 3 additions & 1 deletion src/autoIncrement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ export function AutoIncrementSimple(
logger.info('Starting to increment "%s"', (this.constructor as mongoose.Model<any>).modelName);
for (const field of fields) {
logger.info('Incrementing "%s" by %d', field.field, field.incrementBy);
this[field.field] += field.incrementBy;
// "this as any" is required because mongoose sets a document to default to "unknown" if not explicitly set for hooks
// but in this case it should work just fine
(this as any)[field.field] += field.incrementBy as NonNullable<(typeof field)['incrementBy']>;
}
}
});
Expand Down
73 changes: 54 additions & 19 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1610,14 +1610,14 @@
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e"
integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==

"@typegoose/typegoose@~12.0.0":
version "12.0.0"
resolved "https://registry.yarnpkg.com/@typegoose/typegoose/-/typegoose-12.0.0.tgz#1231b4e23c67c6d673ac25f8b0e0c8f00a166862"
integrity sha512-ZkRtjiCO4k05bLPtUXX3Ho7zMLLOKvg6+3JBVtadpC4xUu5htfDf5H+TI+w1jL1d8Q51aN8mHH7L5hr7OSkzoA==
"@typegoose/typegoose@~12.1.0":
version "12.1.0"
resolved "https://registry.yarnpkg.com/@typegoose/typegoose/-/typegoose-12.1.0.tgz#06da94152fef00e69978ecd5de6db83a7ae420b7"
integrity sha512-RhqsFvTCTshtYxuzsHCGwPLJXgX1sc5aguZJ4w3ax6shVHaVQSG4VZddo/BowfP+0CSjp4J8XeCtrunkzkhJOg==
dependencies:
lodash "^4.17.20"
loglevel "^1.8.1"
reflect-metadata "^0.1.13"
reflect-metadata "^0.2.1"
semver "^7.5.4"
tslib "^2.6.2"

Expand Down Expand Up @@ -1750,6 +1750,13 @@
resolved "https://registry.yarnpkg.com/@types/webidl-conversions/-/webidl-conversions-7.0.1.tgz#2b9a2062b39a7272343c185cdb884f2e52188f75"
integrity sha512-8hKOnOan+Uu+NgMaCouhg3cT9x5fFZ92Jwf+uDLXLu/MFRbXxlWwGeQY7KVHkeSft6RvY+tdxklUBuyY9eIEKg==

"@types/whatwg-url@^11.0.2":
version "11.0.4"
resolved "https://registry.yarnpkg.com/@types/whatwg-url/-/whatwg-url-11.0.4.tgz#ffed0dc8d89d91f62e3f368fcbda222a487c4f63"
integrity sha512-lXCmTWSHJvf0TRSO58nm978b8HJ/EdsSsEKLd3ODHFjo+3VGAyyTp4v50nWvwtzBxSMQrVOK7tcuN0zGPLICMw==
dependencies:
"@types/webidl-conversions" "*"

"@types/whatwg-url@^8.2.1":
version "8.2.2"
resolved "https://registry.yarnpkg.com/@types/whatwg-url/-/whatwg-url-8.2.2.tgz#749d5b3873e845897ada99be4448041d4cc39e63"
Expand Down Expand Up @@ -5117,6 +5124,14 @@ mongodb-connection-string-url@^2.6.0:
"@types/whatwg-url" "^8.2.1"
whatwg-url "^11.0.0"

mongodb-connection-string-url@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.0.tgz#b4f87f92fd8593f3b9365f592515a06d304a1e9c"
integrity sha512-t1Vf+m1I5hC2M5RJx/7AtxgABy1cZmIPQRMXw+gEIPn/cZNF3Oiy+l0UIypUwVB5trcWHq3crg2g3uAR9aAwsQ==
dependencies:
"@types/whatwg-url" "^11.0.2"
whatwg-url "^13.0.0"

[email protected]:
version "9.1.5"
resolved "https://registry.yarnpkg.com/mongodb-memory-server-core/-/mongodb-memory-server-core-9.1.5.tgz#c5a06955f9ae2349edcbaf4f78c78ef98f470308"
Expand All @@ -5143,14 +5158,14 @@ mongodb-memory-server@^9.1.5:
mongodb-memory-server-core "9.1.5"
tslib "^2.6.2"

mongodb@6.2.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-6.2.0.tgz#2c9dcb3eeaf528ed850e94b3df392de6c6b0d7ab"
integrity sha512-d7OSuGjGWDZ5usZPqfvb36laQ9CPhnWkAGHT61x5P95p/8nMVeH8asloMwW6GcYFeB0Vj4CB/1wOTDG2RA9BFA==
mongodb@6.3.0:
version "6.3.0"
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-6.3.0.tgz#ec9993b19f7ed2ea715b903fcac6171c9d1d38ca"
integrity sha512-tt0KuGjGtLUhLoU263+xvQmPHEGTw5LbcNC73EoFRYgSHwZt5tsoJC110hDyO1kjQzpgNrpdcSza9PknWN4LrA==
dependencies:
"@mongodb-js/saslprep" "^1.1.0"
bson "^6.2.0"
mongodb-connection-string-url "^2.6.0"
mongodb-connection-string-url "^3.0.0"

mongodb@^5.9.1:
version "5.9.1"
Expand All @@ -5163,14 +5178,14 @@ mongodb@^5.9.1:
optionalDependencies:
"@mongodb-js/saslprep" "^1.1.0"

mongoose@~8.0.1:
version "8.0.1"
resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-8.0.1.tgz#27dee7cf9cf9b31c7b0536017700290f2b1a1135"
integrity sha512-O3TJrtLCt4H1eGf2HoHGcnOcCTWloQkpmIP3hA9olybX3OX2KUjdIIq135HD5paGjZEDJYKn9fw4eH5N477zqQ==
mongoose@~8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-8.1.0.tgz#25be9a39295c0cbffc971fdd4fb6302dceeb2ded"
integrity sha512-kOA4Xnq2goqNpN9EmYElGNWfxA9H80fxcr7UdJKWi3UMflza0R7wpTihCpM67dE/0MNFljoa0sjQtlXVkkySAQ==
dependencies:
bson "^6.2.0"
kareem "2.5.1"
mongodb "6.2.0"
mongodb "6.3.0"
mpath "0.9.0"
mquery "5.0.0"
ms "2.1.3"
Expand Down Expand Up @@ -5919,6 +5934,11 @@ punycode@^2.1.1:
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f"
integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==

punycode@^2.3.0:
version "2.3.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5"
integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==

pure-rand@^6.0.0:
version "6.0.1"
resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.1.tgz#31207dddd15d43f299fdcdb2f572df65030c19af"
Expand Down Expand Up @@ -6060,10 +6080,10 @@ redeyed@~2.1.0:
dependencies:
esprima "~4.0.0"

reflect-metadata@^0.1.13:
version "0.1.13"
resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.13.tgz#67ae3ca57c972a2aa1642b10fe363fe32d49dc08"
integrity sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==
reflect-metadata@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.2.1.tgz#8d5513c0f5ef2b4b9c3865287f3c0940c1f67f74"
integrity sha512-i5lLI6iw9AU3Uu4szRNPPEkomnkjRTaVt9hy/bn5g/oSzekBSMeLZblcjP74AW0vBabqERLLIrz+gR8QYR54Tw==

registry-auth-token@^4.0.0:
version "4.2.1"
Expand Down Expand Up @@ -6734,6 +6754,13 @@ tr46@^3.0.0:
dependencies:
punycode "^2.1.1"

tr46@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/tr46/-/tr46-4.1.1.tgz#281a758dcc82aeb4fe38c7dfe4d11a395aac8469"
integrity sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==
dependencies:
punycode "^2.3.0"

tr46@~0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
Expand Down Expand Up @@ -6981,6 +7008,14 @@ whatwg-url@^11.0.0:
tr46 "^3.0.0"
webidl-conversions "^7.0.0"

whatwg-url@^13.0.0:
version "13.0.0"
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-13.0.0.tgz#b7b536aca48306394a34e44bda8e99f332410f8f"
integrity sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==
dependencies:
tr46 "^4.1.1"
webidl-conversions "^7.0.0"

whatwg-url@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d"
Expand Down

0 comments on commit 8c66032

Please sign in to comment.