create-egg 4.0.1-beta.0 → 4.1.0-beta.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/dist/templates/egg3-simple-js/package.json +2 -2
- package/dist/templates/egg3-simple-ts/package.json +2 -2
- package/dist/templates/egg3-tegg/app/module/bar/controller/home.ts +1 -6
- package/dist/templates/egg3-tegg/app/module/bar/controller/user.ts +1 -7
- package/dist/templates/egg3-tegg/package.json +2 -2
- package/dist/templates/egg3-tegg/test/app/module/bar/controller/user.test.ts +1 -4
- package/dist/templates/simple-ts/config/config.default.ts +9 -10
- package/dist/templates/tegg/app/module/bar/controller/home.ts +1 -6
- package/dist/templates/tegg/app/module/bar/controller/user.ts +1 -7
- package/dist/templates/tegg/config/config.default.ts +13 -14
- package/dist/templates/tegg/test/app/module/bar/controller/user.test.ts +1 -4
- package/package.json +2 -2
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"egg": "^3.17.5",
|
|
11
|
-
"egg-scripts": "
|
|
11
|
+
"egg-scripts": "3"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"egg-bin": "6",
|
|
15
15
|
"egg-mock": "5",
|
|
16
16
|
"eslint": "8",
|
|
17
|
-
"eslint-config-egg": "
|
|
17
|
+
"eslint-config-egg": "14"
|
|
18
18
|
},
|
|
19
19
|
"engines": {
|
|
20
20
|
"node": ">=18.0.0"
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/mocha": "10",
|
|
28
28
|
"@types/node": "24",
|
|
29
|
-
"@eggjs/tsconfig": "
|
|
29
|
+
"@eggjs/tsconfig": "3",
|
|
30
30
|
"egg-bin": "6",
|
|
31
31
|
"egg-mock": "5",
|
|
32
32
|
"eslint": "8",
|
|
33
|
-
"eslint-config-egg": "
|
|
33
|
+
"eslint-config-egg": "14",
|
|
34
34
|
"typescript": "5"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Inject,
|
|
3
|
-
HTTPController,
|
|
4
|
-
HTTPMethod,
|
|
5
|
-
HTTPMethodEnum,
|
|
6
|
-
HTTPQuery,
|
|
7
|
-
} from '@eggjs/tegg';
|
|
1
|
+
import { Inject, HTTPController, HTTPMethod, HTTPMethodEnum, HTTPQuery } from '@eggjs/tegg';
|
|
8
2
|
import { HelloService } from '@/module/foo';
|
|
9
3
|
|
|
10
4
|
@HTTPController({
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"@eggjs/tegg-eventbus-plugin": "^3.5.2",
|
|
29
29
|
"@eggjs/tegg-plugin": "^3.5.2",
|
|
30
30
|
"@eggjs/tegg-schedule-plugin": "^3.5.2",
|
|
31
|
-
"egg-scripts": "^
|
|
31
|
+
"egg-scripts": "^3.0.0",
|
|
32
32
|
"egg-tracer": "^2.0.0",
|
|
33
33
|
"egg": "^3.31.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"egg-bin": "^6.13.0",
|
|
37
37
|
"egg-mock": "^5.15.2",
|
|
38
|
-
"@eggjs/tsconfig": "
|
|
38
|
+
"@eggjs/tsconfig": "3",
|
|
39
39
|
"@types/mocha": "10",
|
|
40
40
|
"@types/node": "24",
|
|
41
41
|
"oxlint": "1",
|
|
@@ -4,10 +4,7 @@ import { app } from 'egg-mock/bootstrap';
|
|
|
4
4
|
|
|
5
5
|
describe('test/app/module/bar/controller/user.test.ts', () => {
|
|
6
6
|
it('should GET /bar/user status 200', async () => {
|
|
7
|
-
const res = await app
|
|
8
|
-
.httpRequest()
|
|
9
|
-
.get('/bar/user')
|
|
10
|
-
.query({ userId: '20170901' });
|
|
7
|
+
const res = await app.httpRequest().get('/bar/user').query({ userId: '20170901' });
|
|
11
8
|
assert.equal(res.status, 200);
|
|
12
9
|
assert.equal(res.text, 'hello, 20170901');
|
|
13
10
|
});
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineConfig, type EggAppInfo } from 'egg';
|
|
2
2
|
|
|
3
|
-
export default (appInfo: EggAppInfo) => {
|
|
4
|
-
const config = {
|
|
3
|
+
export default defineConfig((appInfo: EggAppInfo) => {
|
|
4
|
+
const config = {
|
|
5
|
+
// use for cookie sign key, should change to your own and keep security
|
|
6
|
+
keys: appInfo.name + '_{{keys}}',
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
// add your egg config in here
|
|
11
|
-
config.middleware = [];
|
|
8
|
+
// add your egg config in here
|
|
9
|
+
middleware: [] as string[],
|
|
10
|
+
};
|
|
12
11
|
|
|
13
12
|
// add your special config in here
|
|
14
13
|
const bizConfig = {
|
|
@@ -20,4 +19,4 @@ export default (appInfo: EggAppInfo) => {
|
|
|
20
19
|
...config,
|
|
21
20
|
...bizConfig,
|
|
22
21
|
};
|
|
23
|
-
};
|
|
22
|
+
});
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Inject,
|
|
3
|
-
HTTPController,
|
|
4
|
-
HTTPMethod,
|
|
5
|
-
HTTPMethodEnum,
|
|
6
|
-
HTTPQuery,
|
|
7
|
-
} from '@eggjs/tegg';
|
|
1
|
+
import { Inject, HTTPController, HTTPMethod, HTTPMethodEnum, HTTPQuery } from '@eggjs/tegg';
|
|
8
2
|
import { HelloService } from '@/module/foo';
|
|
9
3
|
|
|
10
4
|
@HTTPController({
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineConfig, type EggAppInfo } from 'egg';
|
|
2
2
|
|
|
3
|
-
export default (appInfo: EggAppInfo) => {
|
|
4
|
-
const config = {
|
|
3
|
+
export default defineConfig((appInfo: EggAppInfo) => {
|
|
4
|
+
const config = {
|
|
5
|
+
// use for cookie sign key, should change to your own and keep security
|
|
6
|
+
keys: appInfo.name + '_{{keys}}',
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
config.keys = appInfo.name + '_{{keys}}';
|
|
8
|
+
// add your egg config in here
|
|
9
|
+
middleware: [] as string[],
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
config.multipart = {
|
|
16
|
-
mode: 'file',
|
|
11
|
+
// change multipart mode to file
|
|
12
|
+
// @see https://github.com/eggjs/multipart/blob/master/src/config/config.default.ts#L104
|
|
13
|
+
multipart: {
|
|
14
|
+
mode: 'file' as const,
|
|
15
|
+
},
|
|
17
16
|
};
|
|
18
17
|
|
|
19
18
|
// add your special config in here
|
|
@@ -27,4 +26,4 @@ export default (appInfo: EggAppInfo) => {
|
|
|
27
26
|
...config,
|
|
28
27
|
bizConfig,
|
|
29
28
|
};
|
|
30
|
-
};
|
|
29
|
+
});
|
|
@@ -2,10 +2,7 @@ import { test, expect } from 'vitest';
|
|
|
2
2
|
import { app } from '@eggjs/mock/bootstrap';
|
|
3
3
|
|
|
4
4
|
test('should GET /bar/user status 200', async () => {
|
|
5
|
-
const res = await app
|
|
6
|
-
.httpRequest()
|
|
7
|
-
.get('/bar/user')
|
|
8
|
-
.query({ userId: '20170901' });
|
|
5
|
+
const res = await app.httpRequest().get('/bar/user').query({ userId: '20170901' });
|
|
9
6
|
expect(res.status).toBe(200);
|
|
10
7
|
expect(res.text).toBe('hello, 20170901');
|
|
11
8
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-egg",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0-beta.10",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"@types/cross-spawn": "^6.0.6",
|
|
11
11
|
"@types/node": "24.5.2",
|
|
12
12
|
"execa": "^9.6.0",
|
|
13
|
-
"tsdown": "0.15.
|
|
13
|
+
"tsdown": "^0.15.4"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": ">=20.19.0"
|