Skip to content

Commit

Permalink
feat: replace configuration.imports to object directly and deprecated…
Browse files Browse the repository at this point in the history
… string (#657)
  • Loading branch information
czy88840616 authored Oct 8, 2020
1 parent e768ee8 commit f1b42a1
Show file tree
Hide file tree
Showing 85 changed files with 939 additions and 403 deletions.
149 changes: 29 additions & 120 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
# Midway
<p align="center">
<a href="https://midwayjs.org/" target="blank"><img src="https://gw.alicdn.com/tfs/TB1OlNIUAL0gK0jSZFtXXXQCXXa-564-135.png" width="300" alt="Midway Logo" /></a>
</p>

<p align="center">A <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building Serverless services, traditional server-side applications, microservices, and small programs.</p>
<p align="center">
<a href="https://github.com/midwayjs/midway/blob/master/LICENSE" target="_blank"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="GitHub license" /></a>
<a href=""><img src="https://img.shields.io/github/tag/midwayjs/midway.svg" alt="GitHub tag"></a>
<a href="https://travis-ci.org/midwayjs/midway"><img src="https://travis-ci.org/midwayjs/midway.svg?branch=develop" alt="Build Status"></a>
<a href="https://codecov.io/gh/midwayjs/midway/branch/master"><img src="https://img.shields.io/codecov/c/github/midwayjs/midway/master.svg" alt="Test Coverage"></a>
<a href="https://lernajs.io/"><img src="https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg" alt="lerna"></a>
<a href="https://snyk.io/test/npm/midway"><img src="https://snyk.io/test/npm/midway/badge.svg" alt="Known Vulnerabilities"></a>
<a href="https://github.com/midwayjs/midway/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome"></a>
<a href="https://www.codacy.com/app/czy88840616/midway?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=midwayjs/midway&amp;utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/856737478fa94e78bce39d5fc2315cec" alt="Codacy Badge"></a>
<a href="#backers"><img src="https://opencollective.com/midway/backers/badge.svg" alt="Backers on Open Collective"></a> <a href="#sponsors"><img src="https://opencollective.com/midway/sponsors/badge.svg" alt="Sponsors on Open Collective"></a>
<a href="https://gitpod.io/#https://github.com/midwayjs/midway"><img src="https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod" alt="Gitpod Ready-to-Code"></a>
<a href="https://github.com/midwayjs/mwts"><img src="https://img.shields.io/badge/code%20style-midwayjs-brightgreen.svg" alt="Code Style: MidwayJS"></a>
</p>

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/midwayjs/midway/blob/master/LICENSE)
[![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)
[![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)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/856737478fa94e78bce39d5fc2315cec)](https://www.codacy.com/app/czy88840616/midway?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=midwayjs/midway&amp;utm_campaign=Badge_Grade)
[![Backers on Open Collective](https://opencollective.com/midway/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/midway/sponsors/badge.svg)](#sponsors)
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/midwayjs/midway)
[![Code Style: MidwayJS](https://img.shields.io/badge/code%20style-midwayjs-brightgreen.svg)](https://github.com/midwayjs/mwts)

## Description

Midway is a Node.js Web framework written by typescript, which uses the IoC injection mechanism to decouple the business logic of the application and make the development of large Node.js application easier and more natural.
Midway is a Node.js framework for building Serverless Services, traditional server-side applications, microservices and small programs.It written by typescript, which uses the IoC injection mechanism to decouple the business logic of the application and make the development of large Node.js application easier and more natural.

## Installation
Midway can use koa, express or EggJS as the basic web framework. It also provides basic solutions for independent use such as Socket.io, GRPC, Dubbo.js, and RabbitMQ.

In addition, Midway is also a Node.js serverless framework for front-end/full-stack developers. Build applications for the next decade. It can run on AWS, Alibaba Cloud, Tencent Cloud and traditional VM/container. Easily integrate with React and Vue. 🌈

```bash
$ npm install midway --save
```
Node.js >= 10.16.0 required.

## Features

Expand All @@ -31,43 +35,18 @@ Node.js >= 10.16.0 required.
- ✔︎ Good development experience for the future
- ✔︎ Support Egg plugins and koa middleware


## Getting Started

Follow the commands listed below.

```bash
$ npm install midway-init -g
$ midway-init
$ npm install
$ npm run dev
$ open http://localhost:7001
```

## Docs & Community

- [Website && Documentations](https://midwayjs.org/midway/)
- [All Egg Plugins](https://github.com/search?q=topic%3Aegg-plugin&type=Repositories)
- 要查看 v2 中文文档, 请访问 [中文文档](https://www.yuque.com/midwayjs/midway_v2) 📚
- 要查看 v1 中文文档, 请访问 [中文文档](https://www.yuque.com/midwayjs/midway_v1) 📚

## Examples

See [midway-examples](https://github.com/midwayjs/midway-examples).

## Packages

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

| Package | Version | Dependencies | DevDependencies | quality |
|--------|-------|------------|----------|----------|
| [`midway`] | [![midway-svg]][midway-ch] | [![midway-d-svg]][midway-d-link] | [![midway-dd-svg]][midway-dd-link] | [![midway-q-svg]][midway-q-link] |
| [`midway-web`] | [![web-svg]][web-ch] | [![web-d-svg]][web-d-link] | [![web-dd-svg]][web-dd-link] | [![web-q-svg]][web-q-link] |
| [`midway-core`] | [![core-svg]][core-ch] | [![core-d-svg]][core-d-link] | [![core-dd-svg]][core-dd-link] | [![core-q-svg]][core-q-link] |
| [`midway-mock`] | [![mock-svg]][mock-ch] | [![mock-d-svg]][mock-d-link] | [![mock-dd-svg]][mock-dd-link] | [![mock-q-svg]][mock-q-link] |
| [`midway-init`] | [![init-svg]][init-ch] | [![init-d-svg]][init-d-link] | [![init-dd-svg]][init-dd-link] | [![init-q-svg]][init-q-link] |
| [`midway-bin`] | [![bin-svg]][bin-ch] | [![bin-d-svg]][bin-d-link] | [![bin-dd-svg]][bin-dd-link] | [![bin-q-svg]][bin-q-link] |
| [`midway-schedule`] | [![sch-svg]][sch-ch] | [![sch-d-svg]][sch-d-link] | [![sch-dd-svg]][sch-dd-link] | [![sch-q-svg]][sch-q-link] |

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)
Please make sure to read the [Issue Reporting Checklist](CONTRIBUTING.md#reporting-new-issues) before opening an issue. Issues not conforming to the guidelines may be closed immediately.

## Contributors

Expand All @@ -80,76 +59,6 @@ This project exists thanks to all the people who contribute. [[Contribute](CONTR

## License

[MIT](http://github.com/midwayjs/midway/blob/master/LICENSE)


[`midway`]: https://github.com/midwayjs/midway/tree/master/packages/midway
[`midway-web`]: https://github.com/midwayjs/midway/tree/master/packages/midway-web
[`midway-core`]: https://github.com/midwayjs/midway/tree/master/packages/midway-core
[`midway-mock`]: https://github.com/midwayjs/midway/tree/master/packages/midway-mock
[`midway-init`]: https://github.com/midwayjs/midway/tree/master/packages/midway-init
[`midway-bin`]: https://github.com/midwayjs/midway/tree/master/packages/midway-bin
[`midway-schedule`]: https://github.com/midwayjs/midway/tree/master/packages/midway-schedule

[midway-svg]: https://img.shields.io/npm/v/midway.svg?maxAge=86400
[midway-ch]: https://github.com/midwayjs/midway/tree/master/packages/midway/CHANGELOG.md
[midway-d-svg]: https://david-dm.org/midwayjs/midway.svg?path=packages/midway
[midway-d-link]: https://david-dm.org/midwayjs/midway.svg?path=packages/midway
[midway-dd-svg]: https://david-dm.org/midwayjs/midway/dev-status.svg?path=packages/midway
[midway-dd-link]: https://david-dm.org/midwayjs/midway?path=packages/midway#info=devDependencies
[midway-q-svg]: https://npm.packagequality.com/shield/midway.svg
[midway-q-link]: https://packagequality.com/#?package=midway

[web-svg]: https://img.shields.io/npm/v/midway-web.svg?maxAge=86400
[web-ch]: https://github.com/midwayjs/midway/tree/master/midway-web/CHANGELOG.md
[web-d-svg]: https://david-dm.org/midwayjs/midway.svg?path=packages/midway-web
[web-d-link]: https://david-dm.org/midwayjs/midway.svg?path=packages/midway-web
[web-dd-svg]: https://david-dm.org/midwayjs/midway/dev-status.svg?path=packages/midway-web
[web-dd-link]: https://david-dm.org/midwayjs/midway?path=packages/midway-web#info=devDependencies
[web-q-svg]: https://npm.packagequality.com/shield/midway-web.svg
[web-q-link]: https://packagequality.com/#?package=midway-web

[core-svg]: https://img.shields.io/npm/v/midway-core.svg?maxAge=86400
[core-ch]: https://github.com/midwayjs/midway/tree/master/midway-core/CHANGELOG.md
[core-d-svg]: https://david-dm.org/midwayjs/midway.svg?path=packages/midway-core
[core-d-link]: https://david-dm.org/midwayjs/midway.svg?path=packages/midway-core
[core-dd-svg]: https://david-dm.org/midwayjs/midway/dev-status.svg?path=packages/midway-core
[core-dd-link]: https://david-dm.org/midwayjs/midway?path=packages/midway-core#info=devDependencies
[core-q-svg]: https://npm.packagequality.com/shield/midway-core.svg
[core-q-link]: https://packagequality.com/#?package=midway-core

[mock-svg]: https://img.shields.io/npm/v/midway-mock.svg?maxAge=86400
[mock-ch]: https://github.com/midwayjs/midway/tree/master/midway-mock/CHANGELOG.md
[mock-d-svg]: https://david-dm.org/midwayjs/midway.svg?path=packages/midway-mock
[mock-d-link]: https://david-dm.org/midwayjs/midway.svg?path=packages/midway-mock
[mock-dd-svg]: https://david-dm.org/midwayjs/midway/dev-status.svg?path=packages/midway-mock
[mock-dd-link]: https://david-dm.org/midwayjs/midway?path=packages/midway-mock#info=devDependencies
[mock-q-svg]: https://npm.packagequality.com/shield/midway-mock.svg
[mock-q-link]: https://packagequality.com/#?package=midway-mock

[init-svg]: https://img.shields.io/npm/v/midway-init.svg?maxAge=86400
[init-ch]: https://github.com/midwayjs/midway/tree/master/midway-init/CHANGELOG.md
[init-d-svg]: https://david-dm.org/midwayjs/midway.svg?path=packages/midway-init
[init-d-link]: https://david-dm.org/midwayjs/midway.svg?path=packages/midway-init
[init-dd-svg]: https://david-dm.org/midwayjs/midway/dev-status.svg?path=packages/midway-init
[init-dd-link]: https://david-dm.org/midwayjs/midway?path=packages/midway-init#info=devDependencies
[init-q-svg]: https://npm.packagequality.com/shield/midway-init.svg
[init-q-link]: https://packagequality.com/#?package=midway-init

[bin-svg]: https://img.shields.io/npm/v/midway-bin.svg?maxAge=86400
[bin-ch]: https://github.com/midwayjs/midway/tree/master/midway-bin/CHANGELOG.md
[bin-d-svg]: https://david-dm.org/midwayjs/midway.svg?path=packages/midway-bin
[bin-d-link]: https://david-dm.org/midwayjs/midway.svg?path=packages/midway-bin
[bin-dd-svg]: https://david-dm.org/midwayjs/midway/dev-status.svg?path=packages/midway-bin
[bin-dd-link]: https://david-dm.org/midwayjs/midway?path=packages/midway-bin#info=devDependencies
[bin-q-svg]: https://npm.packagequality.com/shield/midway-bin.svg
[bin-q-link]: https://packagequality.com/#?package=midway-bin

[sch-svg]: https://img.shields.io/npm/v/midway-schedule.svg?maxAge=86400
[sch-ch]: https://github.com/midwayjs/midway/tree/master/midway-schedule/CHANGELOG.md
[sch-d-svg]: https://david-dm.org/midwayjs/midway.svg?path=packages/midway-schedule
[sch-d-link]: https://david-dm.org/midwayjs/midway.svg?path=packages/midway-schedule
[sch-dd-svg]: https://david-dm.org/midwayjs/midway/dev-status.svg?path=packages/midway-schedule
[sch-dd-link]: https://david-dm.org/midwayjs/midway?path=packages/midway-schedule#info=devDependencies
[sch-q-svg]: https://npm.packagequality.com/shield/midway-schedule.svg
[sch-q-link]: https://packagequality.com/#?package=midway-schedule
The code in this project is released under the [MIT License](LICENSE).

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fmidwayjs%2Fmidway.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fmidwayjs%2Fmidway?ref=badge_large)
66 changes: 27 additions & 39 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,40 @@
# Midway
<p align="center">
<a href="https://midwayjs.org/" target="blank"><img src="https://gw.alicdn.com/tfs/TB1OlNIUAL0gK0jSZFtXXXQCXXa-564-135.png" width="300" alt="Midway Logo" /></a>
</p>

为企业级应用开发的 Web 全栈框架,基于 typescript,面向未来领域,提供良好的装饰器支持,让应用维护变的更加简单。
<p align="center">Midway 是一个适用于构建 Serverless 服务,传统应用、微服务,小程序后端的 <a href="http://nodejs.org" target="_blank">Node.js</a> 框架。</p>
<p align="center">
<a href="https://github.com/midwayjs/midway/blob/master/LICENSE" target="_blank"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="GitHub license" /></a>
<a href=""><img src="https://img.shields.io/github/tag/midwayjs/midway.svg" alt="GitHub tag"></a>
<a href="https://travis-ci.org/midwayjs/midway"><img src="https://travis-ci.org/midwayjs/midway.svg?branch=develop" alt="Build Status"></a>
<a href="https://codecov.io/gh/midwayjs/midway/branch/master"><img src="https://img.shields.io/codecov/c/github/midwayjs/midway/master.svg" alt="Test Coverage"></a>
<a href="https://lernajs.io/"><img src="https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg" alt="lerna"></a>
<a href="https://snyk.io/test/npm/midway"><img src="https://snyk.io/test/npm/midway/badge.svg" alt="Known Vulnerabilities"></a>
<a href="https://github.com/midwayjs/midway/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome"></a>
<a href="https://www.codacy.com/app/czy88840616/midway?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=midwayjs/midway&amp;utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/856737478fa94e78bce39d5fc2315cec" alt="Codacy Badge"></a>
<a href="#backers"><img src="https://opencollective.com/midway/backers/badge.svg" alt="Backers on Open Collective"></a> <a href="#sponsors"><img src="https://opencollective.com/midway/sponsors/badge.svg" alt="Sponsors on Open Collective"></a>
<a href="https://gitpod.io/#https://github.com/midwayjs/midway"><img src="https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod" alt="Gitpod Ready-to-Code"></a>
<a href="https://github.com/midwayjs/mwts"><img src="https://img.shields.io/badge/code%20style-midwayjs-brightgreen.svg" alt="Code Style: MidwayJS"></a>
</p>

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/midwayjs/midway/blob/master/LICENSE)
[![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)
[![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)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/856737478fa94e78bce39d5fc2315cec)](https://www.codacy.com/app/czy88840616/midway?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=midwayjs/midway&amp;utm_campaign=Badge_Grade)
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/midwayjs/midway)
[![Code Style: MidwayJS](https://img.shields.io/badge/code%20style-midwayjs-brightgreen.svg)](https://github.com/midwayjs/mwts)
## 描述

## 安装
Midway 是一个适用于构建 Serverless 服务,传统应用、微服务,小程序后端的 Node.js 框架。

```bash
$ npm install midway --save
```
需要 Node.js >= 10.16.0。
Midway可以使用 koa,express 或 EggJS 作为基本的 Web 框架。它还提供了独立使用的基本解决方案,例如 Socket.io,GRPC,Dubbo.js 和 RabbitMQ 等。

## 特性

- ✔︎ 精致的中间件分组架构和兼容性
- ✔︎ 可扩展的插件体系生态
- ✔︎ 良好的应用分层和解耦能力
- ✔︎ 面向未来的开发体验

## 快速开始

使用以下命令

```bash
$ npm install midway-init -g
$ midway-init
$ npm install
$ npm run dev
$ open http://localhost:7001
```
此外,Midway 也适用于前端/全栈开发人员的Node.js无服务器框架。构建下一个十年的应用程序。可在AWS,阿里云,腾讯云和传统VM /容器上运行。与 React 和 Vue 轻松集成。 🌈

## 文档和社区

- [官网和文档](https://midwayjs.org/midway/)
- [所有的 Egg 插件](https://github.com/search?q=topic%3Aegg-plugin&type=Repositories)
- [官网](https://midwayj.org)
- 要查看 v2 中文文档, 请访问 [中文文档](https://www.yuque.com/midwayjs/midway_v2) 📚
- 要查看 v1 中文文档, 请访问 [中文文档](https://www.yuque.com/midwayjs/midway_v1) 📚

## 示例

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


## 贡献


Expand All @@ -58,4 +44,6 @@ $ open http://localhost:7001

## License

[MIT](http://github.com/midwayjs/midway/blob/master/LICENSE)
我们的代码使用 [MIT](http://github.com/midwayjs/midway/blob/master/LICENSE) 协议,请放心使用。

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fmidwayjs%2Fmidway.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fmidwayjs%2Fmidway?ref=badge_large)
7 changes: 1 addition & 6 deletions packages/core/src/baseFramework.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
MidwayProcessTypeEnum,
} from './interface';
import { ContainerLoader } from './';
import { APPLICATION_KEY, CONFIG_KEY } from '@midwayjs/decorator';
import { APPLICATION_KEY } from '@midwayjs/decorator';

export abstract class BaseFramework<
APP extends IMidwayApplication,
Expand Down Expand Up @@ -54,11 +54,6 @@ export abstract class BaseFramework<
// 如果没有关闭autoLoad 则进行load
this.containerLoader.loadDirectory(options);

// register config
this.containerLoader.registerHook(CONFIG_KEY, (key: string) => {
return this.getConfiguration(key);
});

// register app
this.containerLoader.registerHook(APPLICATION_KEY, () => {
return this.getApplication();
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/common/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
export const FUNCTION_INJECT_KEY = 'midway:function_inject_key';
export const MIDWAY_ALL_CONFIG = 'midway:all_config_inject_key';
export const PRIVATE_META_DATA_KEY = '__midway_private_meta_data__';
/**
* 静态参数
*
Expand Down
Loading

0 comments on commit f1b42a1

Please sign in to comment.