Skip to content

Commit

Permalink
Merge branch 'release/3.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
davesag committed Aug 19, 2021
2 parents 922afbe + 891d315 commit 0ccb1de
Show file tree
Hide file tree
Showing 14 changed files with 6,567 additions and 5,352 deletions.
6 changes: 3 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
extends: ['standard', 'prettier', 'prettier/standard'],
plugins: ['prettier', 'import', 'promise'],
extends: ['standard', 'plugin:prettier/recommended'],
plugins: ['mocha'],
parserOptions: {
sourceType: 'module'
},
Expand All @@ -10,6 +10,6 @@ module.exports = {
},
rules: {
'prettier/prettier': ['error', { singleQuote: true, semi: false }],
'no-unused-expressions': 0,
'no-unused-expressions': 0
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ typings/

# next.js build output
.next

# VS Code metadata
.vscode/
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no-install lint-staged
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 "username@domain.suffix"

#### 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ const { connector } = require('swagger-routes-express')
| Branch | Status | Coverage | Audit | Notes |
| ------ | ------ | -------- | ----- | ----- |
| `develop` | [![CircleCI](https://circleci.com/gh/davesag/swagger-routes-express/tree/develop.svg?style=svg)](https://circleci.com/gh/davesag/swagger-routes-express/tree/develop) | [![codecov](https://codecov.io/gh/davesag/swagger-routes-express/branch/develop/graph/badge.svg)](https://codecov.io/gh/davesag/swagger-routes-express) | [![Vulnerabilities](https://snyk.io/test/github/davesag/swagger-routes-express/develop/badge.svg)](https://snyk.io/test/github/davesag/swagger-routes-express/develop) | Work in progress |
| `master` | [![CircleCI](https://circleci.com/gh/davesag/swagger-routes-express/tree/master.svg?style=svg)](https://circleci.com/gh/davesag/swagger-routes-express/tree/master) | [![codecov](https://codecov.io/gh/davesag/swagger-routes-express/branch/master/graph/badge.svg)](https://codecov.io/gh/davesag/swagger-routes-express) | [![Vulnerabilities](https://snyk.io/test/github/davesag/swagger-routes-express/master/badge.svg)](https://snyk.io/test/github/davesag/swagger-routes-express/master) | Latest stable release |
| `main` | [![CircleCI](https://circleci.com/gh/davesag/swagger-routes-express/tree/main.svg?style=svg)](https://circleci.com/gh/davesag/swagger-routes-express/tree/main) | [![codecov](https://codecov.io/gh/davesag/swagger-routes-express/branch/main/graph/badge.svg)](https://codecov.io/gh/davesag/swagger-routes-express) | [![Vulnerabilities](https://snyk.io/test/github/davesag/swagger-routes-express/main/badge.svg)](https://snyk.io/test/github/davesag/swagger-routes-express/main) | Latest stable release |

### Prerequisites

Expand Down
56 changes: 33 additions & 23 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,49 @@
// Type definitions for [swagger-routes-express] [3.1.3]
// Project: https://github.com/davesag/swagger-routes-express
// Definitions by: Dave Sag <https://github.com/davesag>
// Marco Rinck <https://github.com/marcorinck>
// Rodrigo Feijao <https://github.com/rodrigofeijao>
// Definitions: https://github.com/davesag/swagger-routes-express
// TypeScript Version: 3.9.x
declare module 'swagger-routes-express' {
import {Handler, Router} from "express";
import { Handler, Router } from 'express'

interface Controllers {
[key: string]: Handler;
[key: string]: Handler
}

interface ConnectorOptions {
security?: {
[key: string]: Handler;
};
security?: {
[key: string]: Handler
}

middleware?: {
[key: string]: Handler;
};
middleware?: {
[key: string]: Handler
}

onCreateRoute?: (method: string, descriptor: any[]) => void;
onCreateRoute?: (method: string, descriptor: any[]) => void

apiSeparator?: string;
notImplemented?: Handler;
notFound?: Handler;
rootTag?: string;
variables?: object;
apiSeparator?: string
notImplemented?: Handler
notFound?: Handler
rootTag?: string
variables?: object
}

interface SummariseOptions {
INVALID_VERSION?: string
}

export function connector(api: Controllers, apiDefinition: object, options?: ConnectorOptions): (router: Router) => void;
export function summarise(apiDefinition: object, options?: SummariseOptions): void;
interface Summary {
info: {
name: string
description: string
version: string
}

paths: {
[key: string]: string[]
}
}

export function connector(
api: Controllers,
apiDefinition: object,
options?: ConnectorOptions
): (router: Router) => void

export function summarise(apiDefinition: object, options?: SummariseOptions): Summary
}
Loading

0 comments on commit 0ccb1de

Please sign in to comment.