@midwayjs/code-dye 3.10.8 → 3.10.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -41
- package/dist/config/config.default.js +0 -1
- package/dist/configuration.js +0 -3
- package/dist/interface.d.ts +0 -1
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -1,45 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
# midway-codedye
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-

|
|
5
|
-
### Usage
|
|
3
|
+
this is a sub package for midway.
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
```shell
|
|
9
|
-
tnpm i @midwayjs/code-dye --save
|
|
10
|
-
```
|
|
11
|
-
2. 在 configuration 中引入组件,
|
|
12
|
-
```ts
|
|
13
|
-
import * as codeDye from '@midwayjs/code-dye';
|
|
14
|
-
@Configuration({
|
|
15
|
-
imports: [
|
|
16
|
-
// ...other components
|
|
17
|
-
codeDye
|
|
18
|
-
],
|
|
19
|
-
})
|
|
20
|
-
export class AutoConfiguration {}
|
|
21
|
-
```
|
|
5
|
+
Document: [https://midwayjs.org](https://midwayjs.org)
|
|
22
6
|
|
|
23
|
-
|
|
7
|
+
## License
|
|
24
8
|
|
|
25
|
-
|
|
26
|
-
```ts
|
|
27
|
-
// src/config/config.default.ts
|
|
28
|
-
export const codeDye = {
|
|
29
|
-
matchQueryKey: 'codeDyeABC',
|
|
30
|
-
}
|
|
31
|
-
```
|
|
32
|
-
然后请求你的接口,例如:http://127.0.0.1:7001/test?codeDyeABC=html
|
|
33
|
-
|
|
34
|
-
### 配置
|
|
35
|
-
```ts
|
|
36
|
-
export const codeDye = {
|
|
37
|
-
// 是否启用
|
|
38
|
-
enable: boolean;
|
|
39
|
-
// 匹配到对应的 header key时,进行代码染色,值可以为 html、json、log
|
|
40
|
-
matchHeaderKey: string;
|
|
41
|
-
// 匹配到对应的 query key时,进行代码染色
|
|
42
|
-
// 例如 http://127.0.0.1:7001/test?codeDye=html
|
|
43
|
-
matchQueryKey: string;
|
|
44
|
-
}
|
|
45
|
-
```
|
|
9
|
+
[MIT]((http://github.com/midwayjs/midway/blob/master/LICENSE))
|
package/dist/configuration.js
CHANGED
|
@@ -16,9 +16,6 @@ const middleware_1 = require("./middleware");
|
|
|
16
16
|
const codeDye_1 = require("./codeDye");
|
|
17
17
|
let CodeDyeConfiguration = class CodeDyeConfiguration {
|
|
18
18
|
async onReady(container) {
|
|
19
|
-
if (!this.codeDye.enable) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
19
|
this.applicationManager
|
|
23
20
|
.getApplications(['koa', 'faas', 'express', 'egg'])
|
|
24
21
|
.forEach(app => {
|
package/dist/interface.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/code-dye",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.10",
|
|
4
4
|
"description": "Midway Code Dye Component",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@midwayjs/core": "^3.10.
|
|
26
|
-
"@midwayjs/express": "^3.10.
|
|
27
|
-
"@midwayjs/faas": "^3.10.
|
|
28
|
-
"@midwayjs/koa": "^3.10.
|
|
29
|
-
"@midwayjs/mock": "^3.10.
|
|
30
|
-
"@midwayjs/serverless-app": "^3.10.
|
|
31
|
-
"@midwayjs/web": "^3.10.
|
|
25
|
+
"@midwayjs/core": "^3.10.10",
|
|
26
|
+
"@midwayjs/express": "^3.10.10",
|
|
27
|
+
"@midwayjs/faas": "^3.10.10",
|
|
28
|
+
"@midwayjs/koa": "^3.10.10",
|
|
29
|
+
"@midwayjs/mock": "^3.10.10",
|
|
30
|
+
"@midwayjs/serverless-app": "^3.10.10",
|
|
31
|
+
"@midwayjs/web": "^3.10.10"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "93d333e82e75b6eb44ab83f74a378172508730d6"
|
|
34
34
|
}
|