Skip to content

Commit

Permalink
Merge branch 'master' into fix_coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsss committed Mar 1, 2019
2 parents 2ac7e1b + ecd85e2 commit 2d40fb5
Show file tree
Hide file tree
Showing 48 changed files with 381 additions and 185 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.4.3](https://github.com/midwayjs/midway/compare/v1.4.2...v1.4.3) (2019-03-01)

**Note:** Version bump only for package midway





## [1.4.2](https://github.com/midwayjs/midway/compare/v1.4.1...v1.4.2) (2019-02-28)

**Note:** Version bump only for package midway
Expand Down
19 changes: 9 additions & 10 deletions README.md
Expand Up @@ -5,7 +5,6 @@
[![GitHub tag](https://img.shields.io/github/tag/midwayjs/midway.svg)]()
[![Build Status](https://travis-ci.org/midwayjs/midway.svg?branch=develop)](https://travis-ci.org/midwayjs/midway)
[![Test Coverage](https://img.shields.io/codecov/c/github/midwayjs/midway/master.svg)](https://codecov.io/gh/midwayjs/midway/branch/master)
[![Package Quality](http://npm.packagequality.com/shield/midway.svg)](http://packagequality.com/#?package=midway)
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lernajs.io/)
[![Known Vulnerabilities](https://snyk.io/test/npm/midway/badge.svg)](https://snyk.io/test/npm/midway)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/midwayjs/midway/pulls)
Expand Down Expand Up @@ -55,15 +54,15 @@ See [midway-examples](https://github.com/midwayjs/midway-examples).

midway is comprised of many specialized packages. This repository contains all these packages. Below you will find a summary of each package.

| Package | Version | Dependencies | DevDependencies |
|--------|-------|------------|----------|
| [`midway`](https://github.com/midwayjs/midway/tree/master/packages/midway) | [![npm (scoped)](https://img.shields.io/npm/v/midway.svg?maxAge=86400)](https://github.com/midwayjs/midway/tree/master/packages/midway/CHANGELOG.md) | [![Dependency Status](https://david-dm.org/midwayjs/midway.svg?path=packages/midway)](https://david-dm.org/midwayjs/midway.svg?path=packages/midway) | [![devDependency Status](https://david-dm.org/midwayjs/midway/dev-status.svg?path=packages/midway)](https://david-dm.org/midwayjs/midway?path=packages/midway#info=devDependencies) |
| [`midway-web`](https://github.com/midwayjs/midway/tree/master/packages/midway-web) | [![npm (scoped)](https://img.shields.io/npm/v/midway-web.svg?maxAge=86400)](https://github.com/midwayjs/midway/tree/master/midway-web/CHANGELOG.md) | [![Dependency Status](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-web)](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-web) | [![devDependency Status](https://david-dm.org/midwayjs/midway/dev-status.svg?path=packages/midway-web)](https://david-dm.org/midwayjs/midway?path=packages/midway-web#info=devDependencies) |
| [`midway-core`](https://github.com/midwayjs/midway/tree/master/packages/midway-core) | [![npm (scoped)](https://img.shields.io/npm/v/midway-core.svg?maxAge=86400)](https://github.com/midwayjs/midway/tree/master/midway-core/CHANGELOG.md) | [![Dependency Status](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-core)](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-core) | [![devDependency Status](https://david-dm.org/midwayjs/midway/dev-status.svg?path=packages/midway-core)](https://david-dm.org/midwayjs/midway?path=packages/midway-core#info=devDependencies) |
| [`midway-mock`](https://github.com/midwayjs/midway/tree/master/packages/midway-mock) | [![npm (scoped)](https://img.shields.io/npm/v/midway-mock.svg?maxAge=86400)](https://github.com/midwayjs/midway/tree/master/midway-mock/CHANGELOG.md) | [![Dependency Status](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-mock)](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-mock) | [![devDependency Status](https://david-dm.org/midwayjs/midway/dev-status.svg?path=packages/midway-mock)](https://david-dm.org/midwayjs/midway?path=packages/midway-mock#info=devDependencies) |
| [`midway-init`](https://github.com/midwayjs/midway/tree/master/packages/midway-init) | [![npm (scoped)](https://img.shields.io/npm/v/midway-init.svg?maxAge=86400)](https://github.com/midwayjs/midway/tree/master/midway-init/CHANGELOG.md) | [![Dependency Status](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-init)](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-init) | [![devDependency Status](https://david-dm.org/midwayjs/midway/dev-status.svg?path=packages/midway-init)](https://david-dm.org/midwayjs/midway?path=packages/midway-init#info=devDependencies) |
| [`midway-bin`](https://github.com/midwayjs/midway/tree/master/packages/midway-bin) | [![npm (scoped)](https://img.shields.io/npm/v/midway-bin.svg?maxAge=86400)](https://github.com/midwayjs/midway/tree/master/midway-bin/CHANGELOG.md) | [![Dependency Status](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-bin)](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-bin) | [![devDependency Status](https://david-dm.org/midwayjs/midway/dev-status.svg?path=packages/midway-bin)](https://david-dm.org/midwayjs/midway?path=packages/midway-bin#info=devDependencies) |
| [`midway-schedule`](https://github.com/midwayjs/midway/tree/master/packages/midway-schedule) | [![npm (scoped)](https://img.shields.io/npm/v/midway-schedule.svg?maxAge=86400)](https://github.com/midwayjs/midway/tree/master/midway-schedule/CHANGELOG.md) | [![Dependency Status](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-schedule)](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-schedule) | [![devDependency Status](https://david-dm.org/midwayjs/midway/dev-status.svg?path=packages/midway-schedule)](https://david-dm.org/midwayjs/midway?path=packages/midway-schedule#info=devDependencies) |
| Package | Version | Dependencies | DevDependencies | quality |
|--------|-------|------------|----------|----------|
| [`midway`](https://github.com/midwayjs/midway/tree/master/packages/midway) | [![npm (scoped)](https://img.shields.io/npm/v/midway.svg?maxAge=86400)](https://github.com/midwayjs/midway/tree/master/packages/midway/CHANGELOG.md) | [![Dependency Status](https://david-dm.org/midwayjs/midway.svg?path=packages/midway)](https://david-dm.org/midwayjs/midway.svg?path=packages/midway) | [![devDependency Status](https://david-dm.org/midwayjs/midway/dev-status.svg?path=packages/midway)](https://david-dm.org/midwayjs/midway?path=packages/midway#info=devDependencies) | [![Package Quality](https://npm.packagequality.com/shield/midway.svg)](https://packagequality.com/#?package=midway) |
| [`midway-web`](https://github.com/midwayjs/midway/tree/master/packages/midway-web) | [![npm (scoped)](https://img.shields.io/npm/v/midway-web.svg?maxAge=86400)](https://github.com/midwayjs/midway/tree/master/midway-web/CHANGELOG.md) | [![Dependency Status](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-web)](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-web) | [![devDependency Status](https://david-dm.org/midwayjs/midway/dev-status.svg?path=packages/midway-web)](https://david-dm.org/midwayjs/midway?path=packages/midway-web#info=devDependencies) | [![Package Quality](https://npm.packagequality.com/shield/midway-web.svg)](https://packagequality.com/#?package=midway-web)|
| [`midway-core`](https://github.com/midwayjs/midway/tree/master/packages/midway-core) | [![npm (scoped)](https://img.shields.io/npm/v/midway-core.svg?maxAge=86400)](https://github.com/midwayjs/midway/tree/master/midway-core/CHANGELOG.md) | [![Dependency Status](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-core)](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-core) | [![devDependency Status](https://david-dm.org/midwayjs/midway/dev-status.svg?path=packages/midway-core)](https://david-dm.org/midwayjs/midway?path=packages/midway-core#info=devDependencies) | [![Package Quality](https://npm.packagequality.com/shield/midway-core.svg)](https://packagequality.com/#?package=midway-core) |
| [`midway-mock`](https://github.com/midwayjs/midway/tree/master/packages/midway-mock) | [![npm (scoped)](https://img.shields.io/npm/v/midway-mock.svg?maxAge=86400)](https://github.com/midwayjs/midway/tree/master/midway-mock/CHANGELOG.md) | [![Dependency Status](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-mock)](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-mock) | [![devDependency Status](https://david-dm.org/midwayjs/midway/dev-status.svg?path=packages/midway-mock)](https://david-dm.org/midwayjs/midway?path=packages/midway-mock#info=devDependencies) | [![Package Quality](https://npm.packagequality.com/shield/midway-mock.svg)](https://packagequality.com/#?package=midway-mock) |
| [`midway-init`](https://github.com/midwayjs/midway/tree/master/packages/midway-init) | [![npm (scoped)](https://img.shields.io/npm/v/midway-init.svg?maxAge=86400)](https://github.com/midwayjs/midway/tree/master/midway-init/CHANGELOG.md) | [![Dependency Status](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-init)](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-init) | [![devDependency Status](https://david-dm.org/midwayjs/midway/dev-status.svg?path=packages/midway-init)](https://david-dm.org/midwayjs/midway?path=packages/midway-init#info=devDependencies) | [![Package Quality](https://npm.packagequality.com/shield/midway-init.svg)](https://packagequality.com/#?package=midway-init) |
| [`midway-bin`](https://github.com/midwayjs/midway/tree/master/packages/midway-bin) | [![npm (scoped)](https://img.shields.io/npm/v/midway-bin.svg?maxAge=86400)](https://github.com/midwayjs/midway/tree/master/midway-bin/CHANGELOG.md) | [![Dependency Status](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-bin)](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-bin) | [![devDependency Status](https://david-dm.org/midwayjs/midway/dev-status.svg?path=packages/midway-bin)](https://david-dm.org/midwayjs/midway?path=packages/midway-bin#info=devDependencies) | [![Package Quality](https://npm.packagequality.com/shield/midway-bin.svg)](https://packagequality.com/#?package=midway-bin) |
| [`midway-schedule`](https://github.com/midwayjs/midway/tree/master/packages/midway-schedule) | [![npm (scoped)](https://img.shields.io/npm/v/midway-schedule.svg?maxAge=86400)](https://github.com/midwayjs/midway/tree/master/midway-schedule/CHANGELOG.md) | [![Dependency Status](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-schedule)](https://david-dm.org/midwayjs/midway.svg?path=packages/midway-schedule) | [![devDependency Status](https://david-dm.org/midwayjs/midway/dev-status.svg?path=packages/midway-schedule)](https://david-dm.org/midwayjs/midway?path=packages/midway-schedule#info=devDependencies) | [![Package Quality](https://npm.packagequality.com/shield/midway-schedule.svg)](https://packagequality.com/#?package=midway-schedule)|

Globally: [![Build Status](https://img.shields.io/travis/midwayjs/midway/master.svg?style=flat)](https://travis-ci.org/midwayjs/midway) [![devDependency Status](https://david-dm.org/midwayjs/midway/dev-status.svg)](https://david-dm.org/midwayjs/midway#info=devDependencies)

Expand Down
11 changes: 10 additions & 1 deletion README.zh-CN.md
Expand Up @@ -6,7 +6,6 @@
[![GitHub tag](https://img.shields.io/github/tag/midwayjs/midway.svg)]()
[![Build Status](https://travis-ci.org/midwayjs/midway.svg?branch=develop)](https://travis-ci.org/midwayjs/midway)
[![Test Coverage](https://img.shields.io/codecov/c/github/midwayjs/midway/master.svg)](https://codecov.io/gh/midwayjs/midway/branch/master)
[![Package Quality](http://npm.packagequality.com/shield/midway.svg)](http://packagequality.com/#?package=midway)
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lernajs.io/)
[![Known Vulnerabilities](https://snyk.io/test/npm/midway/badge.svg)](https://snyk.io/test/npm/midway)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/midwayjs/midway/pulls)
Expand Down Expand Up @@ -39,6 +38,16 @@ $ npm run dev
$ open http://localhost:7001
```

## 文档和社区

- [官网和文档](https://midwayjs.org/midway/)
- [所有的 Egg 插件](https://github.com/search?q=topic%3Aegg-plugin&type=Repositories)

## 示例

请访问 [midway-examples](https://github.com/midwayjs/midway-examples).


## 贡献


Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Expand Up @@ -15,5 +15,5 @@
}
},
"npmClient": "npm",
"version": "1.4.2"
"version": "1.4.3"
}
8 changes: 8 additions & 0 deletions packages/midway-bin/CHANGELOG.md
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.4.3](https://github.com/midwayjs/midway/compare/v1.4.2...v1.4.3) (2019-03-01)

**Note:** Version bump only for package midway-bin





## [1.4.1](https://github.com/midwayjs/midway/compare/v1.4.0...v1.4.1) (2019-02-27)

**Note:** Version bump only for package midway-bin
Expand Down
4 changes: 2 additions & 2 deletions packages/midway-bin/package.json
@@ -1,6 +1,6 @@
{
"name": "midway-bin",
"version": "1.4.1",
"version": "1.4.3",
"description": "Midway Command Tools",
"main": "index.js",
"bin": {
Expand Down Expand Up @@ -32,7 +32,7 @@
"devDependencies": {
"co-mocha": "^1.2.2",
"coffee": "^5.2.1",
"eslint": "^4.13.1",
"eslint": "^5.14.1",
"eslint-config-egg": "^7.0.0",
"mm": "^2.4.1"
},
Expand Down
8 changes: 8 additions & 0 deletions packages/midway-core/CHANGELOG.md
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.4.3](https://github.com/midwayjs/midway/compare/v1.4.2...v1.4.3) (2019-03-01)

**Note:** Version bump only for package midway-core





## [1.4.1](https://github.com/midwayjs/midway/compare/v1.4.0...v1.4.1) (2019-02-27)

**Note:** Version bump only for package midway-core
Expand Down
6 changes: 3 additions & 3 deletions packages/midway-core/package.json
@@ -1,6 +1,6 @@
{
"name": "midway-core",
"version": "1.4.1",
"version": "1.4.3",
"description": "midway core",
"main": "dist/index",
"typings": "dist/index.d.ts",
Expand All @@ -24,7 +24,7 @@
"license": "MIT",
"devDependencies": {
"chai": "^4.2.0",
"midway-bin": "^1.4.1"
"midway-bin": "^1.4.3"
},
"dependencies": {
"camelcase": "^5.0.0",
Expand All @@ -33,7 +33,7 @@
"extend2": "^1.0.0",
"globby": "^9.0.0",
"inflection": "^1.12.0",
"injection": "^1.3.1",
"injection": "^1.3.2",
"is-type-of": "^1.2.1",
"reflect-metadata": "^0.1.13"
},
Expand Down
8 changes: 8 additions & 0 deletions packages/midway-decorator/CHANGELOG.md
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.4.3](https://github.com/midwayjs/midway/compare/v1.4.2...v1.4.3) (2019-03-01)

**Note:** Version bump only for package @midwayjs/decorator





## [1.4.2](https://github.com/midwayjs/midway/compare/v1.4.1...v1.4.2) (2019-02-28)

**Note:** Version bump only for package @midwayjs/decorator
Expand Down
6 changes: 3 additions & 3 deletions packages/midway-decorator/package.json
@@ -1,6 +1,6 @@
{
"name": "@midwayjs/decorator",
"version": "1.4.2",
"version": "1.4.3",
"description": "definition decorator for midway project",
"main": "dist/index",
"typings": "dist/index.d.ts",
Expand All @@ -13,10 +13,10 @@
"autod": "midway-bin autod"
},
"dependencies": {
"injection": "^1.3.1"
"injection": "^1.3.2"
},
"devDependencies": {
"midway-bin": "^1.4.1"
"midway-bin": "^1.4.3"
},
"keywords": [
"midway",
Expand Down
8 changes: 8 additions & 0 deletions packages/midway-definition/CHANGELOG.md
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.4.3](https://github.com/midwayjs/midway/compare/v1.4.2...v1.4.3) (2019-03-01)

**Note:** Version bump only for package @midwayjs/definition





## [1.4.1](https://github.com/midwayjs/midway/compare/v1.4.0...v1.4.1) (2019-02-27)

**Note:** Version bump only for package @midwayjs/definition
Expand Down
4 changes: 2 additions & 2 deletions packages/midway-definition/package.json
@@ -1,6 +1,6 @@
{
"name": "@midwayjs/definition",
"version": "1.4.1",
"version": "1.4.3",
"description": "declare all midway dependencies by typescript definition",
"typings": "dist/index.d.ts",
"scripts": {
Expand All @@ -16,7 +16,7 @@
"egg-logger": "^2.3.1"
},
"devDependencies": {
"midway-bin": "^1.4.1"
"midway-bin": "^1.4.3"
},
"keywords": [
"midway",
Expand Down
8 changes: 8 additions & 0 deletions packages/midway-init/CHANGELOG.md
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.4.3](https://github.com/midwayjs/midway/compare/v1.4.2...v1.4.3) (2019-03-01)

**Note:** Version bump only for package midway-init





## [1.4.1](https://github.com/midwayjs/midway/compare/v1.4.0...v1.4.1) (2019-02-27)

**Note:** Version bump only for package midway-init
Expand Down
7 changes: 6 additions & 1 deletion packages/midway-init/boilerplate/boilerplate.json
Expand Up @@ -2,6 +2,11 @@
"midway-ts": {
"package": "midway-ts-boilerplate",
"description": "Simple midway application boilerplate by ts",
"name": "midway ts"
"name": "midway typescript template"
},
"midway-demo": {
"package": "midway-demo-boilerplate",
"description": "Simple boilerplate for create a midway demo",
"name": "midway demo template"
}
}
@@ -0,0 +1,3 @@
# demo-{{name}}

this is a demo for midway.
@@ -0,0 +1,12 @@
logs/
npm-debug.log
yarn-error.log
node_modules/
package-lock.json
yarn.lock
coverage/
.idea/
run/
.DS_Store
*.sw*
*.un~
@@ -0,0 +1,23 @@
{
"name": "demo-{{name}}",
"version": "1.0.0",
"private": true,
"dependencies": {
"midway": "^1.0.0"
},
"devDependencies": {
"midway-bin": "1",
"midway-demo-lib": "1"
},
"engines": {
"node": ">=8.9.0"
},
"scripts": {
"dev": "NODE_ENV=local midway-bin dev --ts",
"debug": "NODE_ENV=local midway-bin debug --ts",
"test": "midway-bin test --ts",
"cov": "midway-bin cov --ts",
"ci": "midway-bin cov --ts",
"build": "midway-bin build -c"
}
}
@@ -0,0 +1,11 @@
import { controller, get, provide } from 'midway';

@provide()
@controller('/')
export class HomeController {

@get('/')
async index(ctx) {
ctx.body = `Welcome to midwayjs!`;
}
}
@@ -0,0 +1,16 @@
import { controller, get, inject, provide } from 'midway';
import { IUserService, IUserResult } from '../../interface';

@provide()
@controller('/user')
export class UserController {
@inject('userService')
service: IUserService;

@get('/:id')
async getUser(ctx): Promise<void> {
const id: number = ctx.params.id;
const user: IUserResult = await this.service.getUser({id});
ctx.body = {success: true, message: 'OK', data: user};
}
}
@@ -0,0 +1 @@
## public static file directory!
@@ -0,0 +1,12 @@
export = (appInfo: any) => {
const config: any = exports = {};

// use for cookie sign key, should change to your own and keep security
config.keys = appInfo.name + '_{{keys}}';

// add your config here
config.middleware = [
];

return config;
};
@@ -0,0 +1,4 @@
// had enabled by midway
// export = {
// static: true,
// };
@@ -0,0 +1,23 @@
/**
* @description User-Service parameters
*/
export interface IUserOptions {
id: number;
}

/**
* @description User-Service response
*/
export interface IUserResult {
id: number;
username: string;
phone: string;
email?: string;
}

/**
* @description User-Service abstractions
*/
export interface IUserService {
getUser(options: IUserOptions): Promise<IUserResult>;
}
@@ -0,0 +1,15 @@
import { provide } from 'midway';
import { IUserService, IUserOptions, IUserResult } from '../interface';

@provide('userService')
export class UserService implements IUserService {

async getUser(options: IUserOptions): Promise<IUserResult> {
return {
id: options.id,
username: 'mockedName',
phone: '12345678901',
email: 'xxx.xxx@xxx.com',
};
}
}
@@ -0,0 +1,11 @@
const { app, assert } = require('midway-mock/bootstrap');

describe('test/app/controller/home.test.ts', () => {

it('should GET /', () => {
return app.httpRequest()
.get('/')
.expect('Welcome to midwayjs!')
.expect(200);
});
});

0 comments on commit 2d40fb5

Please sign in to comment.