diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 8baad441d9..4569b6706b 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -12,7 +12,7 @@ A clear and concise description of what the bug is. ## Mini Showcase Repository(REQUIRED) > Provide a mini GitHub repository which can reproduce the issue. -> Use `egg-init --type=simple bug` then upload to your GitHub +> Use `npm init egg --type=simple bug` then upload to your GitHub diff --git a/.github/ISSUE_TEMPLATE/bug_report_cn.md b/.github/ISSUE_TEMPLATE/bug_report_cn.md index 87eedf1371..52a9c13262 100644 --- a/.github/ISSUE_TEMPLATE/bug_report_cn.md +++ b/.github/ISSUE_TEMPLATE/bug_report_cn.md @@ -16,7 +16,7 @@ assignees: '' ## 最小可复现仓库 -> 请使用 `egg-init --type=simple bug` 创建,并上传到你的 GitHub 仓库 +> 请使用 `npm init egg --type=simple bug` 创建,并上传到你的 GitHub 仓库 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2eb277f94e..fb231b7c14 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -110,7 +110,7 @@ Feel free to add more content in the body, if you think subject is not self-expl - **If the commit is a Breaking Change, please note it clearly in this part.** - related issues, like `Closes #1, Closes #2, #3` -- If there is a change about an old feaure or a new feature, please associate `doc` and `egg-init`, like `eggjs/egg-bin#123` +- If there is a change about an old feaure or a new feature, please associate `doc` and `egg-core`, like `eggjs/egg-core#123` e.g. diff --git a/CONTRIBUTING.zh-CN.md b/CONTRIBUTING.zh-CN.md index 8aeb956890..2f7b943c9c 100644 --- a/CONTRIBUTING.zh-CN.md +++ b/CONTRIBUTING.zh-CN.md @@ -114,7 +114,7 @@ $ git push origin branch-name - **当有非兼容修改(Breaking Change)时必须在这里描述清楚** - 关联相关 issue,如 `Closes #1, Closes #2, #3` -- 如果功能点有新增或修改的,还需要关联文档 `doc` 和 `egg-init` 的 PR,如 `eggjs/egg-bin#123` +- 如果功能点有新增或修改的,还需要关联文档 `doc` 和 `egg-core` 的 PR,如 `eggjs/egg-core#123` 示例 diff --git a/README.md b/README.md index 9c5f064625..6026e5669a 100644 --- a/README.md +++ b/README.md @@ -54,8 +54,8 @@ Node.js >= 8.0.0 required. Follow the commands listed below. ```bash -$ npm install egg-init -g -$ egg-init --type simple showcase && cd showcase +$ mkdir showcase && cd showcase +$ npm init egg --type=simple $ npm install $ npm run dev $ open http://localhost:7001 diff --git a/README.zh-CN.md b/README.zh-CN.md index 98d2aa3b97..5b23b924ca 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -49,8 +49,8 @@ $ npm install egg --save ## 快速开始 ```bash -$ npm install egg-init -g -$ egg-init --type simple showcase && cd showcase +$ mkdir showcase && cd showcase +$ npm init egg --type=simple $ npm install $ npm run dev $ open http://localhost:7001 diff --git a/docs/source/en/advanced/framework.md b/docs/source/en/advanced/framework.md index b1f5959209..8c538f65e3 100644 --- a/docs/source/en/advanced/framework.md +++ b/docs/source/en/advanced/framework.md @@ -42,11 +42,11 @@ We could regard EggCore as the advanced version of Koa Application, which integr ## How to Customize a Framework -To setup by [egg-init](https://github.com/eggjs/egg-init) with the [framework](https://github.com/eggjs/egg-boilerplate-framework) option is a good way, in which generates a scaffold for you. +Just use [egg-boilerplate-framework](https://github.com/eggjs/egg-boilerplate-framework) to generates a scaffold for you. ```bash -$ egg-init --type=framework yadan -$ cd yadan +$ mkdir yadan && cd yadan +$ npm init egg --type=framework $ npm i $ npm test ``` diff --git a/docs/source/en/advanced/plugin.md b/docs/source/en/advanced/plugin.md index 6aec13b64f..1250bd88fc 100644 --- a/docs/source/en/advanced/plugin.md +++ b/docs/source/en/advanced/plugin.md @@ -16,11 +16,11 @@ As we've already explained some these points in chapter [using plugins](../basic ### Quick Start with Scaffold -You can choose [plugin][egg-boilerplate-plugin] scaffold in [egg-init] for quick start. +Just use [egg-boilerplate-plugin] to generates a scaffold for you. ```bash -$ egg-init --type=plugin egg-hello -$ cd egg-hello +$ mkdir egg-hello && cd egg-hello +$ npm init egg --type=plugin $ npm i $ npm test ``` @@ -478,7 +478,6 @@ What's more, Egg can use this feature to make an adapter, for example, the plugi **Giving the same plugin name and the same API to the same plugin can make quick switch between them**. This is really really useful in template and database. -[egg-init]: https://github.com/eggjs/egg-init [egg-boilerplate-plugin]: https://github.com/eggjs/egg-boilerplate-plugin [egg-mysql]: https://github.com/eggjs/egg-mysql [egg-oss]: https://github.com/eggjs/egg-oss diff --git a/docs/source/en/faq.md b/docs/source/en/faq.md index a68a575c80..ec69f5779c 100644 --- a/docs/source/en/faq.md +++ b/docs/source/en/faq.md @@ -10,7 +10,7 @@ Thank you for reporting an issue. 1. It's RECOMMENDED to submit PR for typo or tiny bug fix. 2. If this's a FEATURE request, please provide: details, pseudo codes if necessary. 3. If this's a BUG, please provide: course repetition, error log and configuration. Fill in as much of the template below as you're able. -4. **It will be nice to use `egg-init --type=simple bug` to provide a mini GitHub repository which can reproduce the issue.** +4. **It will be nice to use `npm init egg --type=simple bug` to provide a mini GitHub repository which can reproduce the issue.** Most importantly, please understand one thing: the relationship between the `user` and `the maintainer of open source project` is not `Buyer` and `Seller`, the issue is not a customer order either. When you're opening an issue, please hold a mentality of "working together to solve this problem." Do not expect us to serve you unilaterally. diff --git a/docs/source/en/intro/quickstart.md b/docs/source/en/intro/quickstart.md index 59878f936d..6d6ce39bb4 100644 --- a/docs/source/en/intro/quickstart.md +++ b/docs/source/en/intro/quickstart.md @@ -15,9 +15,8 @@ To begin with, let's quickly initialize the project by using a scaffold, which will quickly generate some of the major pieces of the application. ```bash -$ npm i egg-init -g -$ egg-init egg-example --type=simple -$ cd egg-example +$ mkdir egg-example && cd egg-example +$ npm init egg --type=simple $ npm i ``` @@ -30,7 +29,7 @@ $ open localhost:7001 ## Step by Step -Usually you can just use [egg-init] of the previous section, +Usually you can just use `npm init egg` of the previous section, choose a scaffold that best fits your business model and quickly generate a project, then get started with the development. @@ -481,7 +480,6 @@ Where to go from here? read our documentation to better understand the framework - Egg framework enables developers to write painless unit testing with many plugins and community-powered toolings. The team should give it a try by using Egg unit testing without worrying about setting up the testing tooling but writing the testing logics. See [Unit Testing](../core/unittest.md). [Node.js]: http://nodejs.org -[egg-init]: https://github.com/eggjs/egg-init [egg-bin]: https://github.com/eggjs/egg-bin [egg-static]: https://github.com/eggjs/egg-static [egg-development]: https://github.com/eggjs/egg-development diff --git a/docs/source/en/style-guide.md b/docs/source/en/style-guide.md index eeeaea55f6..6b4124c64f 100644 --- a/docs/source/en/style-guide.md +++ b/docs/source/en/style-guide.md @@ -1,7 +1,7 @@ title: Code Style Guide --- -Developers are advised to use `egg-init --type=simple showcase` to generate and observe the recommended project structure and configuration. +Developers are advised to use `npm init egg --type=simple showcase` to generate and observe the recommended project structure and configuration. ## Classify diff --git a/docs/source/en/tutorials/index.md b/docs/source/en/tutorials/index.md index 89aec237c9..0555280cb0 100644 --- a/docs/source/en/tutorials/index.md +++ b/docs/source/en/tutorials/index.md @@ -9,14 +9,14 @@ title: Tutorials You can use boilerplate type like this: ```bash -$ egg-init --type=simple +$ npm init egg --type=simple ``` ### Options boilerplate type | Description :----: | ----: -simple | Simple egg app boilerplate -empty | Empty egg app boilerplate +simple | Simple egg app boilerplate +empty | Empty egg app boilerplate plugin | egg plugin boilerplate framework | egg framework boilerplate diff --git a/docs/source/en/tutorials/passport.md b/docs/source/en/tutorials/passport.md index 1c4d8429c9..5e7fb17cf7 100644 --- a/docs/source/en/tutorials/passport.md +++ b/docs/source/en/tutorials/passport.md @@ -229,7 +229,7 @@ In the previous section, we learned how to use a Passport middleware in the fram **initialization:** ```bash -$ egg-init --type=plugin egg-passport-local +$ npm init egg --type=plugin egg-passport-local ``` **Configure dependencies in `package.json`:** diff --git a/docs/source/en/tutorials/restful.md b/docs/source/en/tutorials/restful.md index 21978874e6..2652710de0 100644 --- a/docs/source/en/tutorials/restful.md +++ b/docs/source/en/tutorials/restful.md @@ -101,11 +101,11 @@ After interface convention, we begin to create a RESTful API. ### Application Initialization -Initializes the application using [egg-init](https://github.com/eggjs/egg-init) in the [quickstart](../intro/quickstart.md) +Initializes the application using `npm` in the [quickstart](../intro/quickstart.md) ```bash -$ egg-init cnode-api --type=simple -$ cd cnode-api +$ mkdir cnode-api && cd cnode-api +$ npm init egg --type=simple $ npm i ``` diff --git a/docs/source/en/tutorials/sequelize.md b/docs/source/en/tutorials/sequelize.md index 5af1959a57..ee42ed0435 100644 --- a/docs/source/en/tutorials/sequelize.md +++ b/docs/source/en/tutorials/sequelize.md @@ -11,17 +11,17 @@ In this example, we will use sequelize to connect to the MySQL data source, so w ```bash brew install mysql -brew service start mysql +brew services start mysql ``` ## Initialization -Init project by `egg-init`: +Init project by `npm`: ```bash -egg-init --type=simple --dir=sequelize-project -cd sequelize-project -npm i +$ mkdir sequelize-project && cd sequelize-project +$ npm init egg --type=simple +$ npm i ``` Install and configure the [egg-sequelize] plugin (which will help us load the defined Model object onto `app` and `ctx` ) and the [mysql2] module: @@ -405,7 +405,7 @@ A more complete example can be found in [eggjs/examples/sequelize]. ## Boilerplate -We also provide sequelize boilerplate that integrates the modules [egg-sequelize], [sequelize-cli] and [factory-girl] provided in this documentation. You can quickly initialize a new application based on it by `egg-init --type=sequelize`. +We also provide sequelize boilerplate that integrates the modules [egg-sequelize], [sequelize-cli] and [factory-girl] provided in this documentation. You can quickly initialize a new application based on it by `npm init egg --type=sequelize`. [mysql2]: https://github.com/sidorares/node-mysql2 [sequelize]: http://docs.sequelizejs.com/ diff --git a/docs/source/en/tutorials/typescript.md b/docs/source/en/tutorials/typescript.md index 7bc9890985..b0273e9821 100644 --- a/docs/source/en/tutorials/typescript.md +++ b/docs/source/en/tutorials/typescript.md @@ -26,8 +26,9 @@ For more about this tossing process, please see [[RFC] TypeScript tool support]( A quick initialization through the boilerplate: ```bash -$ npx egg-init --type=ts showcase -$ cd showcase && npm i +$ mkdir showcase && cd showcase +$ npm init egg --type=ts +$ npm i $ npm run dev ``` @@ -415,7 +416,7 @@ What we do is just to do some configs in `package.json`: } ``` -In the latest version of `egg-bin`, we can also support simplify configs of scripts through `egg.require`: +In the latest version of `egg-bin`, we can also support simplify configs of scripts through `egg.require`: ```json { @@ -659,7 +660,7 @@ Here're some questions asked by many people with answers one by one: `egg-scripts` is the cli for PROD, and we suggest you compiling all the ts to js before running because of robustness and capbility. That's the reason why we don't suggest you using `ts-node` to run the application in PROD. -On the contrary, `ts-node` can reduce the cost of management for compiled files from `tsc`in DEV, and the performance loss can almost be ignored, so `ts-node` is integrated into `egg-bin`. +On the contrary, `ts-node` can reduce the cost of management for compiled files from `tsc`in DEV, and the performance loss can almost be ignored, so `ts-node` is integrated into `egg-bin`. **In summary: Please use `tsc`to compile all ts files into js through `npm run tsc`, and then run `npm start`.** diff --git a/docs/source/zh-cn/advanced/framework.md b/docs/source/zh-cn/advanced/framework.md index 5f721b3768..1bead1fd87 100644 --- a/docs/source/zh-cn/advanced/framework.md +++ b/docs/source/zh-cn/advanced/framework.md @@ -42,11 +42,11 @@ EggCore 可以看做 Koa Application 的升级版,默认内置 [Loader](./load ## 如何定制一个框架 -你可以直接通过 [egg-init] 选择 [framework](https://github.com/eggjs/egg-boilerplate-framework) 脚手架来快速上手。 +你可以直接通过 [egg-boilerplate-framework](https://github.com/eggjs/egg-boilerplate-framework) 脚手架来快速上手。 ```bash -$ egg-init --type=framework yadan -$ cd yadan +$ mkdir yadan && cd yadan +$ npm init egg --type=framework $ npm i $ npm test ``` diff --git a/docs/source/zh-cn/advanced/plugin.md b/docs/source/zh-cn/advanced/plugin.md index dfd11ade59..20f5de8534 100644 --- a/docs/source/zh-cn/advanced/plugin.md +++ b/docs/source/zh-cn/advanced/plugin.md @@ -16,11 +16,11 @@ title: 插件开发 ### 使用脚手架快速开发 -你可以直接通过 [egg-init] 选择 [plugin][egg-boilerplate-plugin] 脚手架来快速上手。 +你可以直接使用 [egg-boilerplate-plugin] 脚手架来快速上手。 ```bash -$ egg-init --type=plugin egg-hello -$ cd egg-hello +$ mkdir egg-hello && cd egg-hello +$ npm init egg --type=plugin $ npm i $ npm test ``` @@ -478,7 +478,6 @@ Egg 是通过 `eggPlugin.name` 来定义插件名的,只在应用或框架具 **将相同功能的插件赋予相同的插件名,具备相同的 API,可以快速切换**。这在模板、数据库等领域非常适用。 -[egg-init]: https://github.com/eggjs/egg-init [egg-boilerplate-plugin]: https://github.com/eggjs/egg-boilerplate-plugin [egg-mysql]: https://github.com/eggjs/egg-mysql [egg-oss]: https://github.com/eggjs/egg-oss diff --git a/docs/source/zh-cn/faq.md b/docs/source/zh-cn/faq.md index 069848f499..c92b2176dd 100644 --- a/docs/source/zh-cn/faq.md +++ b/docs/source/zh-cn/faq.md @@ -10,7 +10,7 @@ title: 常见问题 1. 我们推荐如果是小问题(错别字修改,小的 bug fix)直接提交 PR。 2. 如果是一个新需求,请提供:详细需求描述,最好是有伪代码示意。 3. 如果是一个 BUG,请提供:复现步骤,错误日志以及相关配置,并尽量填写下面的模板中的条目。 -4. **如果可以,尽可能使用 `egg-init --type=simple bug` 提供一个最小可复现的代码仓库,方便我们排查问题。** +4. **如果可以,尽可能使用 `npm init egg --type=simple bug` 提供一个最小可复现的代码仓库,方便我们排查问题。** 5. 不要挤牙膏似的交流,扩展阅读:[如何向开源项目提交无法解答的问题](https://zhuanlan.zhihu.com/p/25795393) 最重要的是,请明白一件事:开源项目的用户和维护者之间并不是甲方和乙方的关系,issue 也不是客服工单。在开 issue 的时候,请抱着一种『一起合作来解决这个问题』的心态,不要期待我们单方面地为你服务。 diff --git a/docs/source/zh-cn/intro/quickstart.md b/docs/source/zh-cn/intro/quickstart.md index 8961625a2f..7cd42c4518 100644 --- a/docs/source/zh-cn/intro/quickstart.md +++ b/docs/source/zh-cn/intro/quickstart.md @@ -13,9 +13,8 @@ title: 快速入门 我们推荐直接使用脚手架,只需几条简单指令,即可快速生成项目: ```bash -$ npm i egg-init -g -$ egg-init egg-example --type=simple -$ cd egg-example +$ mkdir egg-example && cd egg-example +$ npm init egg --type=simple $ npm i ``` @@ -28,7 +27,7 @@ $ open localhost:7001 ## 逐步搭建 -通常你可以通过上一节的方式,使用 [egg-init] 快速选择适合对应业务模型的脚手架,快速启动 Egg.js 项目的开发。 +通常你可以通过上一节的方式,使用 `npm init egg` 快速选择适合对应业务模型的脚手架,快速启动 Egg.js 项目的开发。 但为了让大家更好的了解 Egg.js,接下来,我们将跳过脚手架,手动一步步的搭建出一个 [Hacker News](https://github.com/eggjs/examples/tree/master/hackernews)。 @@ -453,7 +452,6 @@ $ npm test - 写单元测试其实很简单的事,Egg 也提供了非常多的配套辅助,我们强烈建议大家测试驱动开发,具体参见 [单元测试](../core/unittest.md)。 [Node.js]: http://nodejs.org -[egg-init]: https://github.com/eggjs/egg-init [egg-bin]: https://github.com/eggjs/egg-bin [egg-static]: https://github.com/eggjs/egg-static [egg-development]: https://github.com/eggjs/egg-development diff --git a/docs/source/zh-cn/style-guide.md b/docs/source/zh-cn/style-guide.md index 755197e0c6..8b3945c672 100644 --- a/docs/source/zh-cn/style-guide.md +++ b/docs/source/zh-cn/style-guide.md @@ -1,7 +1,7 @@ title: 代码风格指南 --- -建议开发者使用 `egg-init --type=simple showcase` 来生成并观察推荐的项目结构和配置。 +建议开发者使用 `npm init egg --type=simple showcase` 来生成并观察推荐的项目结构和配置。 ## 用类的形式呈现(Classify) diff --git a/docs/source/zh-cn/tutorials/index.md b/docs/source/zh-cn/tutorials/index.md index 1ed2c3d28e..56f019b8aa 100644 --- a/docs/source/zh-cn/tutorials/index.md +++ b/docs/source/zh-cn/tutorials/index.md @@ -9,7 +9,7 @@ title: 教程 你可以使用骨架类型,像下面这样: ```bash -$ egg-init --type=simple +$ npm init egg --type=simple ``` ### 选项 diff --git a/docs/source/zh-cn/tutorials/passport.md b/docs/source/zh-cn/tutorials/passport.md index 47b373acfe..bce7c62594 100644 --- a/docs/source/zh-cn/tutorials/passport.md +++ b/docs/source/zh-cn/tutorials/passport.md @@ -230,7 +230,7 @@ module.exports = app => { **初始化:** ```bash -$ egg-init --type=plugin egg-passport-local +$ npm init egg --type=plugin egg-passport-local ``` 在 `package.json` 中**配置依赖:** diff --git a/docs/source/zh-cn/tutorials/restful.md b/docs/source/zh-cn/tutorials/restful.md index 119ba0d574..3be2ea1ff3 100644 --- a/docs/source/zh-cn/tutorials/restful.md +++ b/docs/source/zh-cn/tutorials/restful.md @@ -102,11 +102,11 @@ CNode 社区现在 v1 版本的接口不是完全符合 RESTful 语义,在这 ### 初始化项目 -还是通过[快速入门](../intro/quickstart.md)章节介绍的 [egg-init](https://github.com/eggjs/egg-init) 工具来初始化我们的应用 +还是通过[快速入门](../intro/quickstart.md)章节介绍的 `npm` 来初始化我们的应用 ```bash -$ egg-init cnode-api --type=simple -$ cd cnode-api +$ mkdir cnode-api && cd cnode-api +$ npm init egg --type=simple $ npm i ``` diff --git a/docs/source/zh-cn/tutorials/sequelize.md b/docs/source/zh-cn/tutorials/sequelize.md index e57c055b34..3d367d1714 100644 --- a/docs/source/zh-cn/tutorials/sequelize.md +++ b/docs/source/zh-cn/tutorials/sequelize.md @@ -11,17 +11,17 @@ title: Sequelize ```bash brew install mysql -brew service start mysql +brew services start mysql ``` ## 初始化项目 -通过 egg-init 初始化一个项目: +通过 `npm` 初始化一个项目: ```bash -egg-init --type=simple --dir=sequelize-project -cd sequelize-project -npm i +$ mkdir sequelize-project && cd sequelize-project +$ npm init egg --type=simple +$ npm i ``` 安装并配置 [egg-sequelize] 插件(它会辅助我们将定义好的 Model 对象加载到 app 和 ctx 上)和 [mysql2] 模块: @@ -404,7 +404,7 @@ describe('test/app/service/users.test.js', () => { ## 脚手架 -我们也提供了 sequelize 的脚手架,集成了文档中提供的 [egg-sequelize], [sequelize-cli] 与 [factory-girl] 等模块。可以通过 `egg-init --type=sequelize` 来基于它快速初始化一个新的应用。 +我们也提供了 sequelize 的脚手架,集成了文档中提供的 [egg-sequelize], [sequelize-cli] 与 [factory-girl] 等模块。可以通过 `npm init egg --type=sequelize` 来基于它快速初始化一个新的应用。 [mysql2]: https://github.com/sidorares/node-mysql2 [sequelize]: http://docs.sequelizejs.com/ diff --git a/docs/source/zh-cn/tutorials/typescript.md b/docs/source/zh-cn/tutorials/typescript.md index 9a65176cde..299b99d74e 100644 --- a/docs/source/zh-cn/tutorials/typescript.md +++ b/docs/source/zh-cn/tutorials/typescript.md @@ -26,8 +26,9 @@ TypeScript 的静态类型检查,智能提示,IDE 友好性等特性,对 通过骨架快速初始化: ```bash -$ npx egg-init --type=ts showcase -$ cd showcase && npm i +$ mkdir showcase && cd showcase +$ npm init egg --type=ts +$ npm i $ npm run dev ``` @@ -653,7 +654,7 @@ export default class NewsService extends Service { 汇集一些有不少人提过的 issue 问题并统一解答。 -### 运行 npm start 不会加载 ts +### 运行 npm start 不会加载 ts npm start 运行的是 `egg-scripts start`,而我们只在 egg-bin 中集成了 ts-node,也就是只有在使用 egg-bin 的时候才允许直接运行 ts 。