befly-tpl 3.9.38 → 3.9.40
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 +7 -6
- package/apis/test/hi.ts +1 -3
- package/main.ts +8 -2
- package/package.json +5 -9
- package/env.ts +0 -12
package/README.md
CHANGED
|
@@ -55,7 +55,6 @@ bun run main.ts
|
|
|
55
55
|
|
|
56
56
|
```typescript
|
|
57
57
|
// apis/user/hello.ts
|
|
58
|
-
import { Yes } from 'befly';
|
|
59
58
|
import type { ApiRoute } from 'befly';
|
|
60
59
|
|
|
61
60
|
export default {
|
|
@@ -63,9 +62,12 @@ export default {
|
|
|
63
62
|
auth: false, // 公开接口
|
|
64
63
|
fields: {},
|
|
65
64
|
handler: async (befly, ctx) => {
|
|
66
|
-
return
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
return {
|
|
66
|
+
msg: 'Hello, Befly!',
|
|
67
|
+
data: {
|
|
68
|
+
timestamp: Date.now()
|
|
69
|
+
}
|
|
70
|
+
};
|
|
69
71
|
}
|
|
70
72
|
} as ApiRoute;
|
|
71
73
|
```
|
|
@@ -77,7 +79,6 @@ export default {
|
|
|
77
79
|
### TypeScript 全面支持
|
|
78
80
|
|
|
79
81
|
```typescript
|
|
80
|
-
import { Yes } from 'befly';
|
|
81
82
|
import type { ApiRoute, BeflyContext } from 'befly';
|
|
82
83
|
import type { User } from './types/models';
|
|
83
84
|
|
|
@@ -97,7 +98,7 @@ export default {
|
|
|
97
98
|
where: { id }
|
|
98
99
|
});
|
|
99
100
|
|
|
100
|
-
return
|
|
101
|
+
return { msg: '查询成功', data: user };
|
|
101
102
|
}
|
|
102
103
|
} as ApiRoute;
|
|
103
104
|
```
|
package/apis/test/hi.ts
CHANGED
package/main.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "befly-tpl",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.40",
|
|
4
4
|
"description": "Befly 3.0 TypeScript Template",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -10,9 +10,7 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"dev": "NODE_ENV=development bun run main.ts",
|
|
12
12
|
"start": "NODE_ENV=production bun run main.ts",
|
|
13
|
-
"pm2": "bun --bun pm2 start pm2.config.cjs"
|
|
14
|
-
"sync:api:dev": "NODE_ENV=development bunx befly sync:api",
|
|
15
|
-
"sync:api:prod": "NODE_ENV=production bunx befly sync:api"
|
|
13
|
+
"pm2": "bun --bun pm2 start pm2.config.cjs"
|
|
16
14
|
},
|
|
17
15
|
"files": [
|
|
18
16
|
"apis",
|
|
@@ -20,7 +18,6 @@
|
|
|
20
18
|
"main.ts",
|
|
21
19
|
".npmrc",
|
|
22
20
|
"bunfig.toml",
|
|
23
|
-
"env.ts",
|
|
24
21
|
"LICENSE",
|
|
25
22
|
"main.ts",
|
|
26
23
|
"menu.json",
|
|
@@ -31,12 +28,11 @@
|
|
|
31
28
|
],
|
|
32
29
|
"type": "module",
|
|
33
30
|
"dependencies": {
|
|
34
|
-
"@befly-addon/admin": "1.0.
|
|
35
|
-
"befly": "3.8.
|
|
36
|
-
"befly-cli": "3.9.23"
|
|
31
|
+
"@befly-addon/admin": "1.0.45",
|
|
32
|
+
"befly": "3.8.20"
|
|
37
33
|
},
|
|
38
34
|
"engines": {
|
|
39
35
|
"bun": ">=1.3.0"
|
|
40
36
|
},
|
|
41
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "e43aefa3abeda7a35669778793d39b23b4180c4e"
|
|
42
38
|
}
|