forked from midwayjs/midway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: configuration use package name (midwayjs#485)
- Loading branch information
Showing
27 changed files
with
276 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ package-lock.json | |
.nodejs-cache | ||
.tmp | ||
packages/midway/_package.json | ||
public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/midway-core/test/fixtures/app-with-configuration/midway-plugin-ok/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"name": "midway-plugin-mock", | ||
"name": "midway-plugin-ok", | ||
"main": "src/index.ts" | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/midway-core/test/fixtures/app-with-configuration/midway-plugin-oktwo/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "midway-plugin-oktwo", | ||
"main": "src/index.ts" | ||
} |
5 changes: 5 additions & 0 deletions
5
...ore/test/fixtures/app-with-configuration/midway-plugin-oktwo/src/config/config.default.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export = { | ||
ok: { | ||
text: 'oktwo' | ||
} | ||
}; |
5 changes: 5 additions & 0 deletions
5
...-core/test/fixtures/app-with-configuration/midway-plugin-oktwo/src/config/config.local.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export = { | ||
ok: { | ||
text: 'oktwo' | ||
} | ||
}; |
10 changes: 10 additions & 0 deletions
10
...midway-core/test/fixtures/app-with-configuration/midway-plugin-oktwo/src/configuration.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Configuration } from '@midwayjs/decorator'; | ||
|
||
@Configuration({ | ||
namespace: 'ok', | ||
importConfigs: [ | ||
'./config/config.default', | ||
'./config/config.local' | ||
] | ||
}) | ||
export class AutoConfiguraion {} |
18 changes: 18 additions & 0 deletions
18
...idway-core/test/fixtures/app-with-configuration/midway-plugin-oktwo/src/replaceManager.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Config, Provide, Inject} from '@midwayjs/decorator'; | ||
|
||
@Provide() | ||
export class ReplaceManagerTwo { | ||
hello; | ||
constructor(@Inject() ctx: any) { | ||
this.hello = ctx; | ||
} | ||
@Inject() | ||
ctx: any; | ||
|
||
@Config('ok.text') | ||
config; | ||
|
||
async getOne() { | ||
return this.config; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
packages/midway-web/test/fixtures/complex_injection/userController.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/midway-web/test/fixtures/enhance/base-app-hackernews/config/env
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
daily |
3 changes: 3 additions & 0 deletions
3
packages/midway-web/test/fixtures/enhance/base-app-plugin-error/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "ali-demo" | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/midway-web/test/fixtures/enhance/base-app-plugin-error/src/app/controller/api.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use strict'; | ||
|
||
exports.index = function*() { | ||
this.body = 'hello'; | ||
}; |
4 changes: 4 additions & 0 deletions
4
packages/midway-web/test/fixtures/enhance/base-app-plugin-error/src/app/router.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = function(app) { | ||
app.get('/api/index', 'api'); | ||
app.get('/api', app.controller.api.index); | ||
}; |
15 changes: 15 additions & 0 deletions
15
packages/midway-web/test/fixtures/enhance/base-app-plugin-error/src/config/config.default.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use strict'; | ||
|
||
export const keys = 'key'; | ||
|
||
export const hello = { | ||
a: 1, | ||
b: 2, | ||
d: [1, 2, 3], | ||
}; | ||
|
||
export const plugins = { | ||
bucLogin: false, | ||
}; | ||
|
||
export const container = {}; |
16 changes: 16 additions & 0 deletions
16
packages/midway-web/test/fixtures/enhance/base-app-plugin-error/src/config/plugin.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
module.exports = { | ||
// 默认开启的插件 | ||
|
||
/** | ||
* 支持各个 bu 的健康检查 | ||
*/ | ||
|
||
plugin3: { | ||
enable: true, | ||
path: '../node_modules/plugin3' | ||
}, | ||
plugin2: { | ||
enable: true, | ||
}, | ||
}; |
11 changes: 11 additions & 0 deletions
11
packages/midway-web/test/fixtures/enhance/base-app-plugin-error/src/lib/service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { provide, inject } from '../../../../../../src'; | ||
|
||
@provide() | ||
export class UserService { | ||
@inject() | ||
ctx; | ||
|
||
async hello() { | ||
return 'world,' + Object.keys(this.ctx.query).length; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,5 @@ export const hello = { | |
export const plugins = { | ||
bucLogin: false, | ||
}; | ||
|
||
export const container = {}; |
Oops, something went wrong.