hightjs 0.3.3 → 0.3.5
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/adapters/factory.js +8 -8
- package/dist/adapters/native.js +3 -3
- package/dist/api/console.js +1 -1
- package/dist/auth/client.js +5 -5
- package/dist/auth/components.js +2 -2
- package/dist/auth/core.js +2 -2
- package/dist/auth/react.js +4 -4
- package/dist/auth/routes.js +1 -1
- package/dist/bin/hightjs.js +32 -331
- package/dist/builder.js +7 -19
- package/dist/client/DefaultNotFound.js +1 -1
- package/dist/client/entry.client.js +98 -8
- package/dist/helpers.d.ts +1 -0
- package/dist/helpers.js +130 -29
- package/dist/hotReload.js +25 -16
- package/dist/index.d.ts +1 -1
- package/dist/index.js +26 -36
- package/dist/renderer.js +137 -18
- package/dist/router.js +133 -62
- package/dist/types.d.ts +81 -0
- package/docs/config.md +216 -0
- package/example/hightjs.config.ts +87 -0
- package/example/package-lock.json +633 -3054
- package/example/package.json +3 -3
- package/example/src/web/layout.tsx +57 -3
- package/example/src/web/routes/index.tsx +1 -1
- package/package.json +1 -1
- package/src/adapters/factory.ts +8 -8
- package/src/adapters/native.ts +3 -3
- package/src/api/console.ts +3 -1
- package/src/auth/client.ts +5 -5
- package/src/auth/components.tsx +2 -2
- package/src/auth/core.ts +2 -2
- package/src/auth/react.tsx +4 -4
- package/src/auth/routes.ts +1 -1
- package/src/bin/hightjs.js +33 -394
- package/src/builder.js +7 -20
- package/src/client/DefaultNotFound.tsx +1 -1
- package/src/client/entry.client.tsx +125 -10
- package/src/helpers.ts +144 -30
- package/src/hotReload.ts +25 -16
- package/src/index.ts +33 -39
- package/src/renderer.tsx +142 -18
- package/src/router.ts +142 -63
- package/src/types.ts +108 -0
- package/example/.hweb/entry.client.js +0 -24
- package/example/hweb-dist/main-5KKAYNUU.js +0 -1137
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { HightConfig, HightConfigFunction } from 'hightjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* HightJS Configuration File
|
|
5
|
+
*
|
|
6
|
+
* This file allows you to customize server settings for your HightJS application.
|
|
7
|
+
* You can export either a static configuration object or a function that returns the configuration.
|
|
8
|
+
*
|
|
9
|
+
* In a real project, you would import from 'hightjs' instead:
|
|
10
|
+
* import type { HightConfig, HightConfigFunction } from 'hightjs';
|
|
11
|
+
*/
|
|
12
|
+
const hightConfig: HightConfigFunction = (phase, { defaultConfig }) => {
|
|
13
|
+
const config: HightConfig = {
|
|
14
|
+
/**
|
|
15
|
+
* Maximum number of HTTP headers allowed per request
|
|
16
|
+
* Default: 100
|
|
17
|
+
* Increase this if you need to support requests with many headers
|
|
18
|
+
*/
|
|
19
|
+
maxHeadersCount: 100,
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Timeout in milliseconds for receiving HTTP headers
|
|
23
|
+
* Default: 60000 (60 seconds)
|
|
24
|
+
*/
|
|
25
|
+
headersTimeout: 60000,
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Timeout in milliseconds for a complete request
|
|
29
|
+
* Default: 30000 (30 seconds)
|
|
30
|
+
*/
|
|
31
|
+
requestTimeout: 30000,
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* General server timeout in milliseconds
|
|
35
|
+
* Default: 35000 (35 seconds)
|
|
36
|
+
*/
|
|
37
|
+
serverTimeout: 35000,
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Timeout per individual request in milliseconds
|
|
41
|
+
* Default: 30000 (30 seconds)
|
|
42
|
+
*/
|
|
43
|
+
individualRequestTimeout: 30000,
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Maximum URL length in characters
|
|
47
|
+
* Default: 2048
|
|
48
|
+
*/
|
|
49
|
+
maxUrlLength: 2048,
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Enable HTTP access logging (e.g., GET /api/users 200 15ms)
|
|
53
|
+
* Default: false
|
|
54
|
+
*/
|
|
55
|
+
accessLogging: true,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// You can customize settings based on the phase
|
|
59
|
+
if (phase === 'development') {
|
|
60
|
+
// In development, you might want longer timeouts for debugging
|
|
61
|
+
config.requestTimeout = 60000;
|
|
62
|
+
config.individualRequestTimeout = 60000;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (phase === 'production') {
|
|
66
|
+
// In production, you might want stricter limits
|
|
67
|
+
config.maxHeadersCount = 50;
|
|
68
|
+
config.maxUrlLength = 1024;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return config;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export default hightConfig;
|
|
75
|
+
|
|
76
|
+
// You can also export a static object instead of a function:
|
|
77
|
+
// const staticConfig: HightConfig = {
|
|
78
|
+
// maxHeadersCount: 100,
|
|
79
|
+
// headersTimeout: 60000,
|
|
80
|
+
// requestTimeout: 30000,
|
|
81
|
+
// serverTimeout: 35000,
|
|
82
|
+
// individualRequestTimeout: 30000,
|
|
83
|
+
// maxUrlLength: 2048,
|
|
84
|
+
// };
|
|
85
|
+
//
|
|
86
|
+
// export default staticConfig;
|
|
87
|
+
|