diff --git a/.travis.yml b/.travis.yml index 5ec14674ca..5e7a967b6f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ sudo: false language: node_js node_js: - - '4' - '6' - '7' install: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ebfcd83aff..96c704cd94 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,16 +7,17 @@ or make any change as you wish and submit an [PR](https://github.com/eggjs/egg/i - Please specify what kind of issue it is. - Before you report an issue, please search for related issues. Make sure you are not going to open a duplicate issue. -- Explain your purpose clearly in tags(see __Useful Tags__), title, or content. +- Explain your purpose clearly in tags(see __Useful Tags__), title, or content. -Egg group members will confirm the purpose of the issue, replace more accurate tags for it, identify related milestone, and assign developers working on it. +Egg group members will confirm the purpose of the issue, replace more accurate tags for it, identify related milestone, and assign developers working on it. Tags can be divided into two groups, `type` and `scope`. - type: What kind of issue, e.g. `feature`, `bug`, `documentation`, `performance`, `support` ... -- scope: What did you modified. Which files are modified, e.g. `core: xx`, `plugin: xx`, `deps: xx` +- scope: What did you modified. Which files are modified, e.g. `core: xx`, `plugin: xx`, `deps: xx` + ### Useful Tags -- `support`: the issue asks helps from developers of our group. If you need helps to locate and handle problems or have any idea to improve Egg, mark it as `support`. +- `support`: the issue asks helps from developers of our group. If you need helps to locate and handle problems or have any idea to improve Egg, mark it as `support`. - `bug`: if you find a problem which possiblly could be a bug, please tag it as `bug`. Then our group members will review that issue. If it is confirmed as a bug by our group member, this issue will be tagged as `confirmed`. - A confirmed bug will be resolved prior. - If the bug has negative impact on running online application, it will be tagged as `ciritical`, which refers to top priority, and will be fixed ASAP! @@ -31,36 +32,36 @@ Tags can be divided into two groups, `type` and `scope`. All features must be submitted along with documentations. The documentations should satify several requirements. - Documentations must clarify one or more aspects of the feature, depending on the nature of feature: what it is, why it happens and how it works. -- It's better to include a series of procedues to explain how to fix the problem. You are also encourgaed to provide **simple, but self-explanatory** demo. -All demos should be compiled at [egg/examples](https://github.com/eggjs/examples) repository. +- It's better to include a series of procedues to explain how to fix the problem. You are also encourgaed to provide **simple, but self-explanatory** demo. +All demos should be compiled at [eggjs/examples](https://github.com/eggjs/examples) repository. - Please provide essential urls, such as application process, terminology explainations and references. ## Submitting Code ### Pull Request Guide -If you are developer of egg repo and you are willing to contribute, feel free to create a new branch, finish your modification and submit a PR. Egg group will review your work and merge it to master branch. +If you are developer of egg repo and you are willing to contribute, feel free to create a new branch, finish your modification and submit a PR. Egg group will review your work and merge it to master branch. ```bash -// Create a new branch for development. The name of branch should be semantic, avoiding words like 'update' or 'tmp'. We suggest to use feature/xxx, if the modification is about to implement a new feature. +# Create a new branch for development. The name of branch should be semantic, avoiding words like 'update' or 'tmp'. We suggest to use feature/xxx, if the modification is about to implement a new feature. $ git checkout -b branch-name -// Run the test after you finish your modification. Add new test cases or change old ones if you feel necessary +# Run the test after you finish your modification. Add new test cases or change old ones if you feel necessary $ npm test -// If your modification pass the tests, congradulations it's time to push your work back to us. Notice that the commit message should be wirtten in the following format. -$ git add . // git add -u to delete files +# If your modification pass the tests, congradulations it's time to push your work back to us. Notice that the commit message should be wirtten in the following format. +$ git add . # git add -u to delete files $ git commit -m "fix(role): role.use must xxx" $ git push origin branch-name ``` -Then you can create a Pull Request at [egg](https://github.com/eggjs/egg/pulls) +Then you can create a Pull Request at [egg](https://github.com/eggjs/egg/pulls) No one can garantee how much will be remembered about certain PR after some time. To make sure we can easily recap what happened previously, please provide the following information in your PR. 1. Need: What function you want to achieve (Generally, please point out which issue is related). -2. Updating Reason: Different with issue. Briefly describe your reason and logic about why you need to make such modification. -3. Related Testing: Briefly descirbe what part of testing is relevant to your modification. +2. Updating Reason: Different with issue. Briefly describe your reason and logic about why you need to make such modification. +3. Related Testing: Briefly descirbe what part of testing is relevant to your modification. 4. User Tips: Notice for Egg users. You can skip this part, if the PR is not about update in API or potential compatibility problem. ### Style Guide @@ -69,7 +70,7 @@ Eslint can help to identify styling issues that may exist in your code. Your cod ### Commit Message Format -You are encouraged to use [angular commit-message-format](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit-message-format) to write commit message. In this way, we could have a more trackable history and an automatically generated changelog. +You are encouraged to use [angular commit-message-format](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit-message-format) to write commit message. In this way, we could have a more trackable history and an automatically generated changelog. ```xml (): @@ -139,7 +140,7 @@ egg uses semantic versioning in release process based on [semver]. `master` branch is the latest stable version. `next` branch is the next stable version working in progress. -- All new features will be added into `master` or `next` branch as well as all bug-fix except security issues. In such way, we can motivate developers to update to the latest stable version. +- All new features will be added into `master` or `next` branch as well as all bug-fix except security issues. In such way, we can motivate developers to update to the latest stable version. - If any API is discarded, it should be noted with `deprecate` in current stable version. The old version of API should be compatiable until the release of next stable version. - `master` branch doesn't have publish tag. High-level framework can work with stable versions defined by semantic versioning. - `next` branch is labelled with `next` tag, high-level framework can use `egg@next` to test the in-progress version. @@ -147,7 +148,7 @@ egg uses semantic versioning in release process based on [semver]. ### Release Strategy -In the release of every stable version, there will be a PM who has the following responsibilities in different stages of the release. +In the release of every stable version, there will be a PM who has the following responsibilities in different stages of the release. #### Preparation @@ -177,5 +178,4 @@ All tags mentioned above refere to adding tags from npm in `package.json`. [Release proposal MR]: https://github.com/nodejs/node/pull/4181 [node CHANGELOG]: https://github.com/nodejs/node/blob/master/CHANGELOG.md [1.x milestone]: https://github.com/eggjs/egg/milestone/1 -[alinpm]: http://web.npm.alibaba-inc.com/ [『我是如何发布一个 npm 包的』]: https://fengmk2.com/blog/2016/how-i-publish-a-npm-package diff --git a/CONTRIBUTING.zh-CN.md b/CONTRIBUTING.zh-CN.md index fa746783ef..f6fbb4ecd1 100644 --- a/CONTRIBUTING.zh-CN.md +++ b/CONTRIBUTING.zh-CN.md @@ -36,8 +36,9 @@ - 必须说清楚问题的几个方面:what(是什么),why(为什么),how(怎么做),可根据问题的特性有所侧重。 - how 部分必须包含详尽完整的操作步骤,必要时附上 **足够简单,可运行** 的范例代码, -所有范例代码放在 [egg/examples](https://github.com/eggjs/examples) 库中。 +所有范例代码放在 [eggjs/examples](https://github.com/eggjs/examples) 库中。 - 提供必要的链接,如申请流程,术语解释和参考文档等。 +- 同步修改中英文文档,或者在 PR 里面说明。 ## 提交代码 @@ -46,15 +47,15 @@ 如果你有仓库的开发者权限,而且希望贡献代码,那么你可以创建分支修改代码提交 MR,egg 开发团队会 review 代码合并到主干。 ```bash -// 先创建开发分支开发,分支名应该有含义,避免使用 update、tmp 之类的 +# 先创建开发分支开发,分支名应该有含义,避免使用 update、tmp 之类的 $ git checkout -b branch-name -// 开发完成后跑下测试是否通过,必要时需要新增或修改测试用例 -$ tnpm test +# 开发完成后跑下测试是否通过,必要时需要新增或修改测试用例 +$ npm test -// 测试通过后,提交代码,message 见下面的规范 +# 测试通过后,提交代码,message 见下面的规范 -$ git add . // git add -u 删除文件 +$ git add . # git add -u 删除文件 $ git commit -m "fix(role): role.use must xxx" $ git push origin branch-name ``` @@ -164,7 +165,7 @@ egg 基于 [semver] 语义化版本号进行发布。 - 确认当前 Milestone 所有的 issue 都已关闭或可延期,完成性能测试。 - 发起一个新的 [Release Proposal MR],按照 [node CHANGELOG] 进行 `History` 的编写,修正文档中与版本相关的内容,commits 可以自动生成。 - ``` + ```bash $ npm run commits ``` - 指定下一个大版本的 PM。 @@ -172,9 +173,9 @@ egg 基于 [semver] 语义化版本号进行发布。 #### 发布时: - 将老的稳定版本(master)备份到以当前大版本为名字的分支上(例如 `1.x`),并设置 tag 为 `release-{v}.x`( v 为当前版本,例如 `release-1.x`)。 -- 将 `next` 分支推送到 `master`,成为新的稳定版本分支,并去除 `next` tag,修改 README 中与分支相关的内容(CISE task id)。 -- 发布新的稳定版本到 [alinpm],并通知上层框架进行更新。 -- `tnpm publish` 之前,请先阅读[『我是如何发布一个 npm 包的』]。 +- 将 `next` 分支推送到 `master`,成为新的稳定版本分支,并去除 `next` tag,修改 README 中与分支相关的内容。 +- 发布新的稳定版本到 [npm],并通知上层框架进行更新。 +- `npm publish` 之前,请先阅读[『我是如何发布一个 npm 包的』]。 上述描述中所有的设置 tag 都是指在 `package.json` 中设置 npm 的 tag。 @@ -188,5 +189,5 @@ egg 基于 [semver] 语义化版本号进行发布。 [Release proposal MR]: https://github.com/nodejs/node/pull/4181 [node CHANGELOG]: https://github.com/nodejs/node/blob/master/CHANGELOG.md [1.x milestone]: https://github.com/eggjs/egg/milestone/1 -[alinpm]: http://web.npm.alibaba-inc.com/ +[npm]: http://npmjs.com/ [『我是如何发布一个 npm 包的』]: https://fengmk2.com/blog/2016/how-i-publish-a-npm-package diff --git a/README.md b/README.md index 9009883324..c39b31bf37 100644 --- a/README.md +++ b/README.md @@ -24,12 +24,11 @@ Born to build better enterprise frameworks and apps ## Installation - ```bash $ npm install egg --save ``` -Node.js >= 4.0.0 required, check [document for installation](https://eggjs.org/guide/installation.html). +Node.js >= 6.0.0 required. ## Features @@ -40,7 +39,7 @@ Node.js >= 4.0.0 required, check [document for installation](https://eggjs.org/g ## Docs & Community -- [Website](https://eggjs.org) +- [Website && Document](https://eggjs.org) - [Plugin List](https://eggjs.org/badgeboard/) - [Frameworks](https://eggjs.org/frameworks.html) @@ -58,6 +57,8 @@ $ open http://localhost:7001 ## Examples +See [egg-examples](https://github.com/eggjs/examples). + ## How to Contribute Please let us know what we can help, check [issues](https://github.com/eggjs/egg/issues) for bug reporting and suggestion. diff --git a/README.zh-CN.md b/README.zh-CN.md index be6f007b6c..702331512a 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -1,6 +1,6 @@ ![](https://raw.githubusercontent.com/eggjs/egg/master/docs/assets/egg-logo.png) -为企业级框架和应用而生 +为企业级框架和应用而生的 Web 框架 [![NPM version][npm-image]][npm-url] [![build status][travis-image]][travis-url] @@ -28,26 +28,23 @@ $ npm install egg --save ``` -Node.js >= 4.0.0 required, check [document for installation](https://eggjs.org/guide/installation.html). +支持 Node.js 6.x 以上版本。 ## 特性 -- ✔︎ Build-in process management -- ✔︎ Plugin system -- ✔︎ Framework customization -- ✔︎ Lots of [plugins](https://eggjs.org/badgeboard/) -) +- ✔︎ 内置多进程管理 +- ✔︎ 高度可扩展的插件机制 +- ✔︎ 深度框架定制 +- ✔︎ 丰富的[插件](https://eggjs.org/badgeboard/) ## 文档和社区 -- [Website](https://eggjs.org) -- [Plugin List](https://eggjs.org/badgeboard/) -- [Frameworks](https://eggjs.org/frameworks.html) +- [官方站点 && 文档](https://eggjs.org/zh-cn/) +- [插件列表](https://eggjs.org/badgeboard/) +- [框架列表](https://eggjs.org/frameworks.html) ## 快速开始 -Follow the step - ```bash $ npm install egg-init -g $ egg-init --type simple showcase && cd showcase @@ -58,6 +55,8 @@ $ open http://localhost:7001 ## 示例 +参见 [egg-examples](https://github.com/eggjs/examples)。 + ## 贡献代码 Please let us know what we can help, check [issues](https://github.com/eggjs/egg/issues) for bug reporting and suggestion. diff --git a/appveyor.yml b/appveyor.yml index 2efd0fadf7..ec7400e903 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,5 @@ environment: matrix: - - nodejs_version: '4' - nodejs_version: '6' - nodejs_version: '7' diff --git a/docs/source/zh-cn/core/view.md b/docs/source/zh-cn/core/view.md index 69aceabcbd..0f26264bf6 100644 --- a/docs/source/zh-cn/core/view.md +++ b/docs/source/zh-cn/core/view.md @@ -89,7 +89,7 @@ module.exports = function* home(){ // `app.locals` 会合并到 `this.locals this.app.locals = { a: 1 }; this.locals.b = 2; -console.log(this.locals); // { a: 1, b: 1 } +console.log(this.locals); // { a: 1, b: 2 } // 一次请求过程中,仅会在第一次使用 `this.locals` 时把 `app.locals` 合并进去。 this.app.locals = { a: 2 }; diff --git a/package.json b/package.json index 27212e39c4..4dba4b5b9a 100644 --- a/package.json +++ b/package.json @@ -17,21 +17,21 @@ "agentkeepalive": "^3.0.0", "cluster-client": "^1.0.1", "co": "^4.6.0", - "debug": "^2.3.3", + "debug": "^2.6.0", "delegates": "^1.0.0", - "egg-cluster": "^1.0.0", + "egg-cluster": "^1.2.0", "egg-cookies": "^2.1.0", - "egg-core": "^1.3.1", - "egg-development": "^1.0.2", - "egg-i18n": "^1.0.2", - "egg-logger": "^1.4.1", + "egg-core": "^1.4.0", + "egg-development": "^1.1.0", + "egg-i18n": "^1.1.0", + "egg-logger": "^1.5.0", "egg-logrotator": "^2.2.2", "egg-multipart": "^1.0.0", - "egg-onerror": "^1.1.0", + "egg-onerror": "^1.2.2", "egg-schedule": "^2.2.1", - "egg-security": "^1.2.1", + "egg-security": "^1.3.0", "egg-session": "^1.1.0", - "egg-static": "^1.0.0", + "egg-static": "^1.1.0", "egg-userrole": "^1.0.0", "egg-userservice": "^1.0.0", "egg-validate": "^1.0.0", @@ -44,9 +44,9 @@ "koa-is-json": "^1.0.0", "koa-override": "^1.0.0", "mime-types": "^2.1.13", - "sdk-base": "^2.0.1", + "sdk-base": "^3.0.1", "sendmessage": "^1.1.0", - "urllib": "^2.17.1" + "urllib": "^2.19.0" }, "devDependencies": { "autod": "^2.7.1", @@ -58,19 +58,20 @@ "egg-alinode": "^1.0.3", "egg-bin": "^1.3.0", "egg-ci": "^1.0.3", - "egg-mock": "^1.2.0", + "egg-mock": "^2.0.0", "egg-plugin-puml": "^1.0.0", "egg-view-nunjucks": "^0.5.0", - "eslint": "^3.11.1", + "eslint": "^3.13.1", "eslint-config-egg": "^3.1.0", "estraverse": "^4.1.1", - "formstream": "^1.0.0", + "formstream": "^1.1.0", "glob": "^7.1.1", "ko-sleep": "^1.0.2", "koa": "^1.2.4", - "koa-router": "^5.4.0", + "koa-router": "^7.1.0", "merge-descriptors": "^1.0.1", - "moment": "^2.17.0", + "mm": "^2.0.0", + "moment": "^2.17.1", "mz": "^2.4.0", "npminstall": "^2.1.1", "nunjucks": "^3.0.0", @@ -78,11 +79,11 @@ "pedding": "^1.1.0", "rds": "^0.1.0", "rimraf": "^2.5.4", - "should": "^11.1.1", + "should": "^11.1.2", "stream-wormhole": "^1.0.0", "supertest": "^2.0.1", - "toa": "^2.4.1", - "toa-router": "^1.5.2" + "toa": "^2.5.0", + "toa-router": "^2.0.1" }, "main": "index.js", "files": [ @@ -110,10 +111,10 @@ "url": "https://github.com/eggjs/egg.git" }, "engines": { - "node": ">= 4.0.0" + "node": ">=6.0.0" }, "ci": { - "version": "4, 6, 7" + "version": "6, 7" }, "license": "MIT" }