Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Automattic/mongoose
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7.8.4
Choose a base ref
...
head repository: Automattic/mongoose
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing 306 changed files with 17,639 additions and 10,303 deletions.
29 changes: 9 additions & 20 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -23,6 +23,9 @@ module.exports = {
'**/*.md/*.ts',
'**/*.md/*.typescript'
],
parserOptions: {
project: './tsconfig.json'
},
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended'
@@ -53,29 +56,15 @@ module.exports = {
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/indent': [
'warn',
2,
{
SwitchCase: 1,
ignoredNodes: ['TSTypeParameterInstantiation']
}
],
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/brace-style': 'error',
'@typescript-eslint/no-dupe-class-members': 'error',
'@typescript-eslint/no-redeclare': 'error',
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/object-curly-spacing': [
'error',
'always'
],
'@typescript-eslint/semi': 'error',
'@typescript-eslint/space-before-function-paren': [
'error',
'never'
],
'@typescript-eslint/space-infix-ops': 'off'
'@typescript-eslint/space-infix-ops': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-wrapper-object-types': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off'
}
},
{
6 changes: 3 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -22,13 +22,13 @@ jobs:
runs-on: ubuntu-20.04
name: Benchmark TypeScript Types
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 16
node-version: 22

- run: npm install

6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -21,11 +21,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
config-file: ./.github/codeql/codeql-config.yml
# Override language selection by uncommenting this and choosing your languages
@@ -44,4 +44,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
25 changes: 19 additions & 6 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -28,12 +28,12 @@ jobs:
runs-on: ubuntu-latest
name: Lint Markdown files
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup node
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 16
node-version: 22

- run: npm install

@@ -48,14 +48,27 @@ jobs:
runs-on: ubuntu-20.04
name: Test Generating Docs
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: git fetch --depth=1 --tags # download all tags for documentation

- name: Setup node
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 16
node-version: 22

- run: npm install
- name: Setup MongoDB
run: |
wget -q https://downloads.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-5.0.14.tgz
tar xf mongodb-linux-x86_64-ubuntu2004-5.0.14.tgz
mkdir -p ./data/db/27017 ./data/db/27000
printf "\n--timeout 8000" >> ./test/mocha.opts
./mongodb-linux-x86_64-ubuntu2004-5.0.14/bin/mongod --setParameter ttlMonitorSleepSecs=1 --fork --dbpath ./data/db/27017 --syslog --port 27017
sleep 2
mongod --version
echo `pwd`/mongodb-linux-x86_64-ubuntu2004-5.0.14/bin >> $GITHUB_PATH
- name: Setup config
run: |
echo "module.exports = {uri:'mongodb://127.0.0.1:27017/mongoose_test'};" > ./.config.js
- run: npm run docs:clean
- run: npm run docs:generate
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: stale
uses: actions/stale@v8
uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days'
70 changes: 35 additions & 35 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -2,18 +2,18 @@ name: Test
on:
pull_request:
paths:
- '.github/workflows/test.yml'
- 'package.json'
- 'index.js'
- 'lib/**'
- 'test/**.js'
- ".github/workflows/test.yml"
- "package.json"
- "index.js"
- "lib/**"
- "test/**.js"
push:
paths:
- '.github/workflows/test.yml'
- 'package.json'
- 'index.js'
- 'lib/**'
- 'test/**.js'
- ".github/workflows/test.yml"
- "package.json"
- "index.js"
- "lib/**"
- "test/**.js"
permissions:
contents: read

@@ -22,12 +22,12 @@ jobs:
runs-on: ubuntu-latest
name: Lint JS-Files
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup node
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 14
node-version: 22

- run: npm install

@@ -39,35 +39,35 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [14, 16, 18, 20]
node: [16, 18, 20, 22]
os: [ubuntu-20.04, ubuntu-22.04]
mongodb: [4.4.28, 5.0.25, 6.0.14, 7.0.7]
mongodb: [4.4.29, 5.0.26, 6.0.15, 7.0.12, 8.0.0]
include:
- os: ubuntu-20.04 # customize on which matrix the coverage will be collected on
mongodb: 5.0.25
mongodb: 5.0.26
node: 16
coverage: true
exclude:
- os: ubuntu-22.04 # exclude because there are no 4.x mongodb builds for 2204
mongodb: 4.4.28
mongodb: 4.4.29
- os: ubuntu-22.04 # exclude because there are no 5.x mongodb builds for 2204
mongodb: 5.0.25
mongodb: 5.0.26
name: Node ${{ matrix.node }} MongoDB ${{ matrix.mongodb }} OS ${{ matrix.os }}
env:
MONGOMS_VERSION: ${{ matrix.mongodb }}
MONGOMS_PREFER_GLOBAL_PATH: 1
FORCE_COLOR: true
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup node
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: ${{ matrix.node }}

- name: Load MongoDB binary cache
id: cache-mongodb-binaries
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/mongodb-binaries
key: ${{ matrix.os }}-${{ matrix.mongodb }}
@@ -80,33 +80,33 @@ jobs:
run: npm run test-coverage
if: matrix.coverage == true
- name: Archive code coverage results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: matrix.coverage == true
with:
name: coverage
path: coverage

test-deno:
runs-on: ubuntu-20.04
name: Deno tests
env:
MONGOMS_VERSION: 6.0.14
MONGOMS_VERSION: 6.0.15
MONGOMS_PREFER_GLOBAL_PATH: 1
FORCE_COLOR: true
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup node
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 16
node-version: 22
- name: Load MongoDB binary cache
id: cache-mongodb-binaries
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/mongodb-binaries
key: deno-${{ env.MONGOMS_VERSION }}
- name: Setup Deno
uses: denoland/setup-deno@v1
uses: denoland/setup-deno@v2
with:
deno-version: v1.37.x
- run: deno --version
@@ -117,16 +117,16 @@ jobs:
test-replica-sets:
needs:
- test
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
name: Replica Set tests
env:
FORCE_COLOR: true
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup node
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 16
node-version: 22
- run: npm install
- name: Test
run: npm run test-rs
@@ -139,6 +139,6 @@ jobs:
contents: read
steps:
- name: Check out repo
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Dependency review
uses: actions/dependency-review-action@v3
uses: actions/dependency-review-action@v4
6 changes: 3 additions & 3 deletions .github/workflows/tidelift-alignment.yml
Original file line number Diff line number Diff line change
@@ -15,11 +15,11 @@ jobs:
if: github.repository == 'Automattic/mongoose'
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup node
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 16
node-version: 22
- name: Alignment
uses: tidelift/alignment-action@8d7700fe795fc01179c1f9fa05b72a089873027d # main
env:
14 changes: 6 additions & 8 deletions .github/workflows/tsd.yml
Original file line number Diff line number Diff line change
@@ -7,8 +7,6 @@ on:
- 'types/**'
- 'test/types/**'
push:
branches:
- master
paths:
- '.github/workflows/tsd.yml'
- 'package.json'
@@ -22,12 +20,12 @@ jobs:
runs-on: ubuntu-latest
name: Lint TS-Files
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup node
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 14
node-version: 22

- run: npm install

@@ -40,12 +38,12 @@ jobs:
runs-on: ubuntu-latest
name: Test Typescript Types
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup node
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 14
node-version: 22

- run: npm install

6 changes: 6 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -57,3 +57,9 @@ tsconfig.json
# scripts
scripts/
tools/

*.0x
valnotes.md

coverage
.nyc_output
Loading