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: 188b4e7872fd6da2e70c8463de9b43de12046764
Choose a base ref
...
head repository: Automattic/mongoose
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 07946be9d79ec345d8cb3e1e650bf30214604342
Choose a head ref
Loading
Showing 506 changed files with 47,887 additions and 43,456 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
docs/
bin/
test/triage/
test/model.discriminator.test.js
tools/
test/es-next/
test/files/
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -5,7 +5,9 @@
**What is the current behavior?**

**If the current behavior is a bug, please provide the steps to reproduce.**
<!-- If you can, provide a standalone script / gist to reproduce your issue -->
<!-- If you can, provide a standalone script / gist to reproduce your issue. -->

<!-- If you are using TypeScript, please include your `tsconfig.json` -->

**What is the expected behavior?**

56 changes: 56 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Test
on:
pull_request:
push:
jobs:
test:
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
node: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Upgrade Node 5 npm
run: npm install -g npm@3
if: ${{ matrix.node == 5 }}

- run: npm install

- name: Setup
run: |
wget -q http://downloads.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.0.2.tgz
tar xf mongodb-linux-x86_64-ubuntu1804-4.0.2.tgz
mkdir -p ./data/db/27017 ./data/db/27000
printf "\n--timeout 8000" >> ./test/mocha.opts
./mongodb-linux-x86_64-ubuntu1804-4.0.2/bin/mongod --fork --dbpath ./data/db/27017 --syslog --port 27017
sleep 2
mongod --version
mkdir ./test/typescript/node_modules
ln -s `pwd` ./test/typescript/node_modules/mongoose
echo `pwd`/mongodb-linux-x86_64-ubuntu1804-4.0.2/bin >> $GITHUB_PATH
- run: npm test

lint:
runs-on: ubuntu-latest
name: Linter
steps:
- uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 14

- run: npm install

- name: Linter
run: npm run lint
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -34,12 +34,17 @@ tools/31*

*.key

docs/*.html

# Webpack output
dist
test/files/main.js

package-lock.json

.config*

# Compiled docs
docs/*.html
docs/tutorials/*.html
docs/typescript/*.html
docs/api/*.html
index.html
7 changes: 5 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@ bin/
tools/31*
*.key
data/
dist/

*.txt
*.png
@@ -25,6 +24,7 @@ examples/
.vscode
.eslintignore
CONTRIBUTING.md
History.*
format_deps.js
release-items.md
static.js
@@ -33,4 +33,7 @@ website.js
.config*

migrating_to_5.md
renovate.json
renovate.json
.travis.yml
webpack.config.js
webpack.base.config.js
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

22 changes: 8 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -6,22 +6,21 @@ If you have a question about Mongoose (not a bug report) please post it to eithe

- Before opening a new issue, look for existing [issues](https://github.com/Automattic/mongoose/issues) to avoid duplication. If the issue does not yet exist, [create one](https://github.com/Automattic/mongoose/issues/new).
- Please post any relevant code samples, preferably a standalone script that
reproduces your issue. Do **not** describe your issue in prose, show your
code.
reproduces your issue. Do **not** describe your issue in prose. **Show your code.**
- If the bug involves an error, please post the stack trace.
- Please post the version of mongoose and mongodb that you're using.
 - Please write bug reports in JavaScript (ES5, ES6, etc) that runs in Node.js, not coffeescript, typescript, etc.
- Please post the version of Mongoose and MongoDB that you're using.
 - Please write bug reports in JavaScript (ES5, ES6, etc) that runs in Node.js, **not** CoffeeScript, TypeScript, JSX, etc.

### Requesting new features

- Before opening a new issue, look for existing [issues](https://github.com/learnboost/mongoose/issues) to avoid duplication. If the issue does not yet exist, [create one](https://github.com/learnboost/mongoose/issues/new).
- Please describe a use case for it
- it would be ideal to include test cases as well
- Please include test cases if possible

### Fixing bugs / Adding features

- Before starting to write code, look for existing [issues](https://github.com/learnboost/mongoose/issues). That way you avoid working on something that might not be of interest or that has been addressed already in a different branch. You can create a new issue [here](https://github.com/learnboost/mongoose/issues/new).
- _The source of this project is written in javascript, not coffeescript or typescript. Please write your bug reports in JavaScript that can run in vanilla Node.js_.
- _The source of this project is written in JavaScript, not CoffeeScript or TypeScript. Please write your bug reports in JavaScript that can run in vanilla Node.js_.
- Fork the [repo](https://github.com/Automattic/mongoose) _or_ for small documentation changes, navigate to the source on github and click the [Edit](https://github.com/blog/844-forking-with-the-edit-button) button.
- Follow the general coding style of the rest of the project:
- 2 space tabs
@@ -37,7 +36,7 @@ If you have a question about Mongoose (not a bug report) please post it to eithe
### Running the tests
- Open a terminal and navigate to the root of the project
- execute `npm install` to install the necessary dependencies
- start a mongodb instance on port 27017 if one isn't running already. `mongod --dbpath <path to store data> --port 27017 --storageEngine mmapv1`. Mongoose tests run much faster on the mmapv1 storage engine as opposed to the WiredTiger storage engine.
- start a MongoDB instance on port 27017 if one isn't running already. `mongod --dbpath <path to store data>`. We typically use [MongoDB Enterprise](https://www.mongodb.com/try/download/enterprise) with the [in-memory storage engine](https://docs.mongodb.com/manual/core/inmemory/) in order to run tests faster.
- execute `npm test` to run the tests (we're using [mocha](http://mochajs.org/))
- or to execute a single test `npm test -- -g 'some regexp that matches the test description'`
- any mocha flags can be specified with `-- <mocha flags here>`
@@ -51,11 +50,12 @@ To contribute to the [guide](http://mongoosejs.com/docs/guide.html) or [quick st

If you'd like to preview your documentation changes, first commit your changes to your local master branch, then execute:

* `npm install`
* `make docclean`
* `make gendocs`
* `node static.js`

Visit `http://localhost:8088` and you should see the docs with your local changes. Make sure you `git reset --hard` before commiting, because changes to `docs/*` should **not** be in PRs.
Visit `http://localhost:8088` and you should see the docs with your local changes. Make sure you `git reset --hard` before committing, because changes to `docs/*` should **not** be in PRs.

### Plugins website

@@ -83,9 +83,3 @@ Thank you to all our backers! [[Become a backer](https://opencollective.com/mong

<a href="https://opencollective.com/mongoose#backers" target="_blank"><img src="https://opencollective.com/mongoose/backers.svg?width=890"></a>


### Sponsors

Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/mongoose#sponsor))

<a href="https://mixmax.com" target="_blank"><img src="http://mongoosejs.com/docs/images/mixmax.png"></a>
Loading