Skip to content

Commit

Permalink
Merge branch 'release/1.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
davesag committed Aug 12, 2021
2 parents 4b109e4 + eed6d72 commit 8dc7a7a
Show file tree
Hide file tree
Showing 17 changed files with 3,190 additions and 2,564 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
extends: ['standard', 'plugin:prettier/recommended'],
plugins: ['import', 'promise', 'mocha'],
plugins: ['mocha'],
parserOptions: {
sourceType: 'module'
},
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ typings/

# macOS finder metadata
.DS_Store

# VS Code config
.vscode/
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ See this handy, if ugly, [cheat sheet](http://danielkummer.github.io/git-flow-ch
2. clone your fork to your local development machine
3. Set this repo as the `upstream` repo `git remote add upstream <insert the upstream url>`
4. Disallow direct pushing to upstream `git remote set-url --push upstream no_push`
5. create a local `master` branch `git checkout -b master` and test it via `git pull upstream master`
5. create a local `main` branch `git checkout -b main` and test it via `git pull upstream main`
6. ensure you have installed the [`git-flow` command line helpers](https://github.com/nvie/gitflow) and [`git-flow-completion` utils](https://github.com/bobthecow/git-flow-completion) then run `git flow init -d`.

#### Optional Git Setup
Expand Down Expand Up @@ -46,15 +46,15 @@ git config user.email "[email protected]"

#### Hotfixes and Support branches

It's basically the same process but use the word `hotfix` or `support` instead of `feature`. `git flow` knows what to do. Just keep in mind that any changes are going to happen to your fork, and not the upstream repo. If you need to merge a `hotfix` into upstream master you may only do it va a reviewed pull request.
It's basically the same process but use the word `hotfix` or `support` instead of `feature`. `git flow` knows what to do. Just keep in mind that any changes are going to happen to your fork, and not the upstream repo. If you need to merge a `hotfix` into upstream main you may only do it va a reviewed pull request.

### Releasing to production

1. `git flow release start {tag.number}` (using semantic versioning)
2. commit any changes to version info in `package.json` then `git flow release publish {tag.number}`
3. `git flow release finish {tag.number}` merges the release into `master` of your fork, tags it, merges that back into `develop` on your fork and removes the release branch.
4. Now go back to GitHub and raise a Pull Request to merge the upstream master from your fork's `master` branch. When that goes through you are done.
5. In your command-line go back and clean up any outstanding branches and `git pull upstream` your local `master` and `develop` branches to ensure everything on your local machine is up to date with everyone's changes.
3. `git flow release finish {tag.number}` merges the release into `main` of your fork, tags it, merges that back into `develop` on your fork and removes the release branch.
4. Now go back to GitHub and raise a Pull Request to merge the upstream main from your fork's `main` branch. When that goes through you are done.
5. In your command-line go back and clean up any outstanding branches and `git pull upstream` your local `main` and `develop` branches to ensure everything on your local machine is up to date with everyone's changes.

Note you will **never** push changes directly to the upstream project, _only to your own fork_.

Expand Down
34 changes: 23 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ const model = (sequelize, DataTypes) => {
{
indexes: [
{ unique: true, fields: ['email'] },
{ unique: true, fields: ['token'] }
{ unique: true, fields: ['token'] },
{ unique: false, fields: ['firstName', 'lastName'] }
]
}
)
Expand Down Expand Up @@ -133,21 +134,32 @@ describe('src/models/User', () => {
})

context('indexes', () => {
;['email', 'token'].forEach(checkUniqueIndex(user))
context('unique', () => {
;['email', 'token'].forEach(checkUniqueIndex(user))
})

context('non unique (and also composite in this example)', () => {
;[['firstname', 'lastname']].forEach(checkNonUniqueIndex(user))
})
})
})
```

### Built-in checks

| Check | What it does |
| -------------------------- | -------------------------------------------------------- |
| `checkHookDefined` | Checks that a particular hook is defined. |
| `checkModelName` | Checks that the model is named correctly. |
| `checkNonUniqueIndex` | Checks that a specific non-unique index is defined. |
| `checkPropertyExists` | Checks that the model has defined the given property. |
| `checkUniqueCompoundIndex` | Checks that a specific unique compound index is defined. |
| `checkUniqueIndex` | Checks that a specific unique index is defined. |
| Check | What it does |
| --------------------- | ----------------------------------------------------- |
| `checkHookDefined` | Checks that a particular hook is defined. |
| `checkModelName` | Checks that the model is named correctly. |
| `checkNonUniqueIndex` | Checks that a specific non-unique index is defined. |
| `checkPropertyExists` | Checks that the model has defined the given property. |
| `checkUniqueIndex` | Checks that a specific unique index is defined. |

#### Deprecation notice

| Check | Note |
| -------------------------- | ------------------------------------------------------ |
| `checkUniqueCompoundIndex` | Use either `checkUniqueIndex` or `checkNonUniqueIndex` |

### Checking associations

Expand Down Expand Up @@ -390,7 +402,7 @@ By default `makeMockModels` and `listModels` will both look for your models in f
| Branch | Status | Coverage | Audit | Notes |
| ------ | ------ | -------- | ----- | ----- |
| `develop` | [![CircleCI](https://circleci.com/gh/davesag/sequelize-test-helpers/tree/develop.svg?style=svg)](https://circleci.com/gh/davesag/sequelize-test-helpers/tree/develop) | [![codecov](https://codecov.io/gh/davesag/sequelize-test-helpers/branch/develop/graph/badge.svg)](https://codecov.io/gh/davesag/sequelize-test-helpers) | [![Vulnerabilities](https://snyk.io/test/github/davesag/sequelize-test-helpers/develop/badge.svg)](https://snyk.io/test/github/davesag/sequelize-test-helpers/develop) | Work in progress |
| `master` | [![CircleCI](https://circleci.com/gh/davesag/sequelize-test-helpers/tree/master.svg?style=svg)](https://circleci.com/gh/davesag/sequelize-test-helpers/tree/master) | [![codecov](https://codecov.io/gh/davesag/sequelize-test-helpers/branch/master/graph/badge.svg)](https://codecov.io/gh/davesag/sequelize-test-helpers) | [![Vulnerabilities](https://snyk.io/test/github/davesag/sequelize-test-helpers/master/badge.svg)](https://snyk.io/test/github/davesag/sequelize-test-helpers/master) | Latest stable release |
| `main` | [![CircleCI](https://circleci.com/gh/davesag/sequelize-test-helpers/tree/main.svg?style=svg)](https://circleci.com/gh/davesag/sequelize-test-helpers/tree/main) | [![codecov](https://codecov.io/gh/davesag/sequelize-test-helpers/branch/main/graph/badge.svg)](https://codecov.io/gh/davesag/sequelize-test-helpers) | [![Vulnerabilities](https://snyk.io/test/github/davesag/sequelize-test-helpers/main/badge.svg)](https://snyk.io/test/github/davesag/sequelize-test-helpers/main) | Latest stable release |

### Prerequisites

Expand Down
Loading

0 comments on commit 8dc7a7a

Please sign in to comment.