@shuvi/shared 1.0.28 → 1.0.30
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/esm/constants/trace.d.ts +166 -0
- package/esm/constants/trace.js +145 -0
- package/esm/reporter.d.ts +12 -0
- package/esm/reporter.js +1 -0
- package/lib/constants/trace.d.ts +166 -0
- package/lib/constants/trace.js +148 -0
- package/lib/reporter.d.ts +12 -0
- package/lib/reporter.js +2 -0
- package/package.json +6 -2
- /package/esm/{constants.d.ts → constants/index.d.ts} +0 -0
- /package/esm/{constants.js → constants/index.js} +0 -0
- /package/lib/{constants.d.ts → constants/index.d.ts} +0 -0
- /package/lib/{constants.js → constants/index.js} +0 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/** category SERVER_CREATE_APP */
|
|
2
|
+
export declare const SERVER_CREATE_APP: {
|
|
3
|
+
name: string;
|
|
4
|
+
events: {
|
|
5
|
+
SHUVI_SERVER_CREATE_APP: {
|
|
6
|
+
name: string;
|
|
7
|
+
duration: boolean;
|
|
8
|
+
};
|
|
9
|
+
SHUVI_SERVER_APP_INIT: {
|
|
10
|
+
name: string;
|
|
11
|
+
duration: boolean;
|
|
12
|
+
};
|
|
13
|
+
SHUVI_SERVER_RUN_LOADERS: {
|
|
14
|
+
name: string;
|
|
15
|
+
duration: boolean;
|
|
16
|
+
attrs: {
|
|
17
|
+
error: {
|
|
18
|
+
name: string;
|
|
19
|
+
type: string;
|
|
20
|
+
};
|
|
21
|
+
errorType: {
|
|
22
|
+
name: string;
|
|
23
|
+
type: string;
|
|
24
|
+
enum: string[];
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
/** category SERVER_REQUEST */
|
|
31
|
+
export declare const SERVER_REQUEST: {
|
|
32
|
+
name: string;
|
|
33
|
+
events: {
|
|
34
|
+
SHUVI_SERVER_HANDLE_REQUEST_START: {
|
|
35
|
+
name: string;
|
|
36
|
+
duration: boolean;
|
|
37
|
+
};
|
|
38
|
+
SHUVI_SERVER_RUN_PAGE_MIDDLEWARE: {
|
|
39
|
+
name: string;
|
|
40
|
+
duration: boolean;
|
|
41
|
+
attrs: {
|
|
42
|
+
error: {
|
|
43
|
+
name: string;
|
|
44
|
+
type: string;
|
|
45
|
+
};
|
|
46
|
+
statusCode: {
|
|
47
|
+
name: string;
|
|
48
|
+
type: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
SHUVI_SERVER_RENDER_TO_STRING: {
|
|
53
|
+
name: string;
|
|
54
|
+
duration: boolean;
|
|
55
|
+
attrs: {
|
|
56
|
+
error: {
|
|
57
|
+
name: string;
|
|
58
|
+
type: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
SHUVI_SERVER_RENDER_TO_HTML: {
|
|
63
|
+
name: string;
|
|
64
|
+
duration: boolean;
|
|
65
|
+
};
|
|
66
|
+
SHUVI_SERVER_SEND_HTML_HOOK: {
|
|
67
|
+
name: string;
|
|
68
|
+
duration: boolean;
|
|
69
|
+
};
|
|
70
|
+
SHUVI_SERVER_SEND_HTML_ORIGINAL: {
|
|
71
|
+
name: string;
|
|
72
|
+
duration: boolean;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
/** category CLIENT_ENTRY */
|
|
77
|
+
export declare const CLIENT_ENTRY: {
|
|
78
|
+
name: string;
|
|
79
|
+
events: {
|
|
80
|
+
SHUVI_CLIENT_ENTRY_START: {
|
|
81
|
+
name: string;
|
|
82
|
+
duration: boolean;
|
|
83
|
+
};
|
|
84
|
+
SHUVI_CLIENT_SETUP_ENV: {
|
|
85
|
+
name: string;
|
|
86
|
+
duration: boolean;
|
|
87
|
+
};
|
|
88
|
+
SHUVI_CLIENT_CREATE_APP: {
|
|
89
|
+
name: string;
|
|
90
|
+
duration: boolean;
|
|
91
|
+
};
|
|
92
|
+
SHUVI_CLIENT_APP_INIT: {
|
|
93
|
+
name: string;
|
|
94
|
+
duration: boolean;
|
|
95
|
+
};
|
|
96
|
+
SHUVI_CLIENT_RUN_APP: {
|
|
97
|
+
name: string;
|
|
98
|
+
duration: boolean;
|
|
99
|
+
};
|
|
100
|
+
SHUVI_CLIENT_DO_RENDER: {
|
|
101
|
+
name: string;
|
|
102
|
+
duration: boolean;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
/** category CLIENT_RENDER */
|
|
107
|
+
export declare const CLIENT_RENDER: {
|
|
108
|
+
name: string;
|
|
109
|
+
events: {
|
|
110
|
+
SHUVI_PAGE_READY: {
|
|
111
|
+
name: string;
|
|
112
|
+
duration: boolean;
|
|
113
|
+
};
|
|
114
|
+
SHUVI_NAVIGATION_TRIGGERED: {
|
|
115
|
+
name: string;
|
|
116
|
+
duration: boolean;
|
|
117
|
+
attrs: {
|
|
118
|
+
from: {
|
|
119
|
+
name: string;
|
|
120
|
+
type: string;
|
|
121
|
+
};
|
|
122
|
+
to: {
|
|
123
|
+
name: string;
|
|
124
|
+
type: string;
|
|
125
|
+
};
|
|
126
|
+
navigationId: {
|
|
127
|
+
name: string;
|
|
128
|
+
type: string;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
SHUVI_NAVIGATION_DONE: {
|
|
133
|
+
name: string;
|
|
134
|
+
duration: boolean;
|
|
135
|
+
attrs: {
|
|
136
|
+
from: {
|
|
137
|
+
name: string;
|
|
138
|
+
type: string;
|
|
139
|
+
};
|
|
140
|
+
to: {
|
|
141
|
+
name: string;
|
|
142
|
+
type: string;
|
|
143
|
+
};
|
|
144
|
+
navigationId: {
|
|
145
|
+
name: string;
|
|
146
|
+
type: string;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
SHUVI_CLIENT_RUN_LOADERS: {
|
|
151
|
+
name: string;
|
|
152
|
+
duration: boolean;
|
|
153
|
+
attrs: {
|
|
154
|
+
error: {
|
|
155
|
+
name: string;
|
|
156
|
+
type: string;
|
|
157
|
+
};
|
|
158
|
+
errorType: {
|
|
159
|
+
name: string;
|
|
160
|
+
type: string;
|
|
161
|
+
enum: string[];
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
const runLoadersAttrs = {
|
|
2
|
+
error: {
|
|
3
|
+
name: 'error',
|
|
4
|
+
type: 'boolean'
|
|
5
|
+
},
|
|
6
|
+
errorType: {
|
|
7
|
+
name: 'errorType',
|
|
8
|
+
type: 'string',
|
|
9
|
+
enum: ['redirect', 'userError', 'unexpectedError']
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
/** category SERVER_CREATE_APP */
|
|
13
|
+
export const SERVER_CREATE_APP = {
|
|
14
|
+
name: 'SERVER_CREATE_APP',
|
|
15
|
+
events: {
|
|
16
|
+
SHUVI_SERVER_CREATE_APP: {
|
|
17
|
+
name: 'SHUVI_SERVER_CREATE_APP',
|
|
18
|
+
duration: true
|
|
19
|
+
},
|
|
20
|
+
SHUVI_SERVER_APP_INIT: {
|
|
21
|
+
name: 'SHUVI_SERVER_APP_INIT',
|
|
22
|
+
duration: true
|
|
23
|
+
},
|
|
24
|
+
SHUVI_SERVER_RUN_LOADERS: {
|
|
25
|
+
name: 'SHUVI_SERVER_RUN_LOADERS',
|
|
26
|
+
duration: true,
|
|
27
|
+
attrs: runLoadersAttrs
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
/** category SERVER_REQUEST */
|
|
32
|
+
export const SERVER_REQUEST = {
|
|
33
|
+
name: 'SERVER_REQUEST',
|
|
34
|
+
events: {
|
|
35
|
+
SHUVI_SERVER_HANDLE_REQUEST_START: {
|
|
36
|
+
name: 'SHUVI_SERVER_HANDLE_REQUEST_START',
|
|
37
|
+
duration: false
|
|
38
|
+
},
|
|
39
|
+
SHUVI_SERVER_RUN_PAGE_MIDDLEWARE: {
|
|
40
|
+
name: 'SHUVI_SERVER_RUN_PAGE_MIDDLEWARE',
|
|
41
|
+
duration: true,
|
|
42
|
+
attrs: {
|
|
43
|
+
error: {
|
|
44
|
+
name: 'error',
|
|
45
|
+
type: 'boolean'
|
|
46
|
+
},
|
|
47
|
+
statusCode: {
|
|
48
|
+
name: 'statusCode',
|
|
49
|
+
type: 'number'
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
SHUVI_SERVER_RENDER_TO_STRING: {
|
|
54
|
+
name: 'SHUVI_SERVER_RENDER_TO_STRING',
|
|
55
|
+
duration: true,
|
|
56
|
+
attrs: {
|
|
57
|
+
error: {
|
|
58
|
+
name: 'error',
|
|
59
|
+
type: 'boolean'
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
SHUVI_SERVER_RENDER_TO_HTML: {
|
|
64
|
+
name: 'SHUVI_SERVER_RENDER_TO_HTML',
|
|
65
|
+
duration: true
|
|
66
|
+
},
|
|
67
|
+
SHUVI_SERVER_SEND_HTML_HOOK: {
|
|
68
|
+
name: 'SHUVI_SERVER_SEND_HTML_HOOK',
|
|
69
|
+
duration: true
|
|
70
|
+
},
|
|
71
|
+
SHUVI_SERVER_SEND_HTML_ORIGINAL: {
|
|
72
|
+
name: 'SHUVI_SERVER_SEND_HTML_ORIGINAL',
|
|
73
|
+
duration: true
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
/** category CLIENT_ENTRY */
|
|
78
|
+
export const CLIENT_ENTRY = {
|
|
79
|
+
name: 'CLIENT_ENTRY',
|
|
80
|
+
events: {
|
|
81
|
+
SHUVI_CLIENT_ENTRY_START: {
|
|
82
|
+
name: 'SHUVI_CLIENT_ENTRY_START',
|
|
83
|
+
duration: false
|
|
84
|
+
},
|
|
85
|
+
SHUVI_CLIENT_SETUP_ENV: {
|
|
86
|
+
name: 'SHUVI_CLIENT_SETUP_ENV',
|
|
87
|
+
duration: true
|
|
88
|
+
},
|
|
89
|
+
SHUVI_CLIENT_CREATE_APP: {
|
|
90
|
+
name: 'SHUVI_CLIENT_CREATE_APP',
|
|
91
|
+
duration: true
|
|
92
|
+
},
|
|
93
|
+
SHUVI_CLIENT_APP_INIT: {
|
|
94
|
+
name: 'SHUVI_CLIENT_APP_INIT',
|
|
95
|
+
duration: true
|
|
96
|
+
},
|
|
97
|
+
SHUVI_CLIENT_RUN_APP: {
|
|
98
|
+
name: 'SHUVI_CLIENT_RUN_APP',
|
|
99
|
+
duration: true
|
|
100
|
+
},
|
|
101
|
+
SHUVI_CLIENT_DO_RENDER: {
|
|
102
|
+
name: 'SHUVI_CLIENT_DO_RENDER',
|
|
103
|
+
duration: true
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
const navigationAttrs = {
|
|
108
|
+
from: {
|
|
109
|
+
name: 'from',
|
|
110
|
+
type: 'string'
|
|
111
|
+
},
|
|
112
|
+
to: {
|
|
113
|
+
name: 'to',
|
|
114
|
+
type: 'string'
|
|
115
|
+
},
|
|
116
|
+
navigationId: {
|
|
117
|
+
name: 'navigationId',
|
|
118
|
+
type: 'string'
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
/** category CLIENT_RENDER */
|
|
122
|
+
export const CLIENT_RENDER = {
|
|
123
|
+
name: 'CLIENT_RENDER',
|
|
124
|
+
events: {
|
|
125
|
+
SHUVI_PAGE_READY: {
|
|
126
|
+
name: 'SHUVI_PAGE_READY',
|
|
127
|
+
duration: false
|
|
128
|
+
},
|
|
129
|
+
SHUVI_NAVIGATION_TRIGGERED: {
|
|
130
|
+
name: 'SHUVI_NAVIGATION_TRIGGERED',
|
|
131
|
+
duration: true,
|
|
132
|
+
attrs: navigationAttrs
|
|
133
|
+
},
|
|
134
|
+
SHUVI_NAVIGATION_DONE: {
|
|
135
|
+
name: 'SHUVI_NAVIGATION_DONE',
|
|
136
|
+
duration: true,
|
|
137
|
+
attrs: navigationAttrs
|
|
138
|
+
},
|
|
139
|
+
SHUVI_CLIENT_RUN_LOADERS: {
|
|
140
|
+
name: 'SHUVI_CLIENT_RUN_LOADERS',
|
|
141
|
+
duration: true,
|
|
142
|
+
attrs: runLoadersAttrs
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare type SpanId = number;
|
|
2
|
+
export declare type traceData = {
|
|
3
|
+
timestamp: number;
|
|
4
|
+
name: string;
|
|
5
|
+
duration: number;
|
|
6
|
+
startTime: number;
|
|
7
|
+
endTime: number;
|
|
8
|
+
id: SpanId;
|
|
9
|
+
parentId?: SpanId;
|
|
10
|
+
attrs?: Object;
|
|
11
|
+
};
|
|
12
|
+
export declare type Reporter = (data: traceData) => void;
|
package/esm/reporter.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/** category SERVER_CREATE_APP */
|
|
2
|
+
export declare const SERVER_CREATE_APP: {
|
|
3
|
+
name: string;
|
|
4
|
+
events: {
|
|
5
|
+
SHUVI_SERVER_CREATE_APP: {
|
|
6
|
+
name: string;
|
|
7
|
+
duration: boolean;
|
|
8
|
+
};
|
|
9
|
+
SHUVI_SERVER_APP_INIT: {
|
|
10
|
+
name: string;
|
|
11
|
+
duration: boolean;
|
|
12
|
+
};
|
|
13
|
+
SHUVI_SERVER_RUN_LOADERS: {
|
|
14
|
+
name: string;
|
|
15
|
+
duration: boolean;
|
|
16
|
+
attrs: {
|
|
17
|
+
error: {
|
|
18
|
+
name: string;
|
|
19
|
+
type: string;
|
|
20
|
+
};
|
|
21
|
+
errorType: {
|
|
22
|
+
name: string;
|
|
23
|
+
type: string;
|
|
24
|
+
enum: string[];
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
/** category SERVER_REQUEST */
|
|
31
|
+
export declare const SERVER_REQUEST: {
|
|
32
|
+
name: string;
|
|
33
|
+
events: {
|
|
34
|
+
SHUVI_SERVER_HANDLE_REQUEST_START: {
|
|
35
|
+
name: string;
|
|
36
|
+
duration: boolean;
|
|
37
|
+
};
|
|
38
|
+
SHUVI_SERVER_RUN_PAGE_MIDDLEWARE: {
|
|
39
|
+
name: string;
|
|
40
|
+
duration: boolean;
|
|
41
|
+
attrs: {
|
|
42
|
+
error: {
|
|
43
|
+
name: string;
|
|
44
|
+
type: string;
|
|
45
|
+
};
|
|
46
|
+
statusCode: {
|
|
47
|
+
name: string;
|
|
48
|
+
type: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
SHUVI_SERVER_RENDER_TO_STRING: {
|
|
53
|
+
name: string;
|
|
54
|
+
duration: boolean;
|
|
55
|
+
attrs: {
|
|
56
|
+
error: {
|
|
57
|
+
name: string;
|
|
58
|
+
type: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
SHUVI_SERVER_RENDER_TO_HTML: {
|
|
63
|
+
name: string;
|
|
64
|
+
duration: boolean;
|
|
65
|
+
};
|
|
66
|
+
SHUVI_SERVER_SEND_HTML_HOOK: {
|
|
67
|
+
name: string;
|
|
68
|
+
duration: boolean;
|
|
69
|
+
};
|
|
70
|
+
SHUVI_SERVER_SEND_HTML_ORIGINAL: {
|
|
71
|
+
name: string;
|
|
72
|
+
duration: boolean;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
/** category CLIENT_ENTRY */
|
|
77
|
+
export declare const CLIENT_ENTRY: {
|
|
78
|
+
name: string;
|
|
79
|
+
events: {
|
|
80
|
+
SHUVI_CLIENT_ENTRY_START: {
|
|
81
|
+
name: string;
|
|
82
|
+
duration: boolean;
|
|
83
|
+
};
|
|
84
|
+
SHUVI_CLIENT_SETUP_ENV: {
|
|
85
|
+
name: string;
|
|
86
|
+
duration: boolean;
|
|
87
|
+
};
|
|
88
|
+
SHUVI_CLIENT_CREATE_APP: {
|
|
89
|
+
name: string;
|
|
90
|
+
duration: boolean;
|
|
91
|
+
};
|
|
92
|
+
SHUVI_CLIENT_APP_INIT: {
|
|
93
|
+
name: string;
|
|
94
|
+
duration: boolean;
|
|
95
|
+
};
|
|
96
|
+
SHUVI_CLIENT_RUN_APP: {
|
|
97
|
+
name: string;
|
|
98
|
+
duration: boolean;
|
|
99
|
+
};
|
|
100
|
+
SHUVI_CLIENT_DO_RENDER: {
|
|
101
|
+
name: string;
|
|
102
|
+
duration: boolean;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
/** category CLIENT_RENDER */
|
|
107
|
+
export declare const CLIENT_RENDER: {
|
|
108
|
+
name: string;
|
|
109
|
+
events: {
|
|
110
|
+
SHUVI_PAGE_READY: {
|
|
111
|
+
name: string;
|
|
112
|
+
duration: boolean;
|
|
113
|
+
};
|
|
114
|
+
SHUVI_NAVIGATION_TRIGGERED: {
|
|
115
|
+
name: string;
|
|
116
|
+
duration: boolean;
|
|
117
|
+
attrs: {
|
|
118
|
+
from: {
|
|
119
|
+
name: string;
|
|
120
|
+
type: string;
|
|
121
|
+
};
|
|
122
|
+
to: {
|
|
123
|
+
name: string;
|
|
124
|
+
type: string;
|
|
125
|
+
};
|
|
126
|
+
navigationId: {
|
|
127
|
+
name: string;
|
|
128
|
+
type: string;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
SHUVI_NAVIGATION_DONE: {
|
|
133
|
+
name: string;
|
|
134
|
+
duration: boolean;
|
|
135
|
+
attrs: {
|
|
136
|
+
from: {
|
|
137
|
+
name: string;
|
|
138
|
+
type: string;
|
|
139
|
+
};
|
|
140
|
+
to: {
|
|
141
|
+
name: string;
|
|
142
|
+
type: string;
|
|
143
|
+
};
|
|
144
|
+
navigationId: {
|
|
145
|
+
name: string;
|
|
146
|
+
type: string;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
SHUVI_CLIENT_RUN_LOADERS: {
|
|
151
|
+
name: string;
|
|
152
|
+
duration: boolean;
|
|
153
|
+
attrs: {
|
|
154
|
+
error: {
|
|
155
|
+
name: string;
|
|
156
|
+
type: string;
|
|
157
|
+
};
|
|
158
|
+
errorType: {
|
|
159
|
+
name: string;
|
|
160
|
+
type: string;
|
|
161
|
+
enum: string[];
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CLIENT_RENDER = exports.CLIENT_ENTRY = exports.SERVER_REQUEST = exports.SERVER_CREATE_APP = void 0;
|
|
4
|
+
const runLoadersAttrs = {
|
|
5
|
+
error: {
|
|
6
|
+
name: 'error',
|
|
7
|
+
type: 'boolean'
|
|
8
|
+
},
|
|
9
|
+
errorType: {
|
|
10
|
+
name: 'errorType',
|
|
11
|
+
type: 'string',
|
|
12
|
+
enum: ['redirect', 'userError', 'unexpectedError']
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
/** category SERVER_CREATE_APP */
|
|
16
|
+
exports.SERVER_CREATE_APP = {
|
|
17
|
+
name: 'SERVER_CREATE_APP',
|
|
18
|
+
events: {
|
|
19
|
+
SHUVI_SERVER_CREATE_APP: {
|
|
20
|
+
name: 'SHUVI_SERVER_CREATE_APP',
|
|
21
|
+
duration: true
|
|
22
|
+
},
|
|
23
|
+
SHUVI_SERVER_APP_INIT: {
|
|
24
|
+
name: 'SHUVI_SERVER_APP_INIT',
|
|
25
|
+
duration: true
|
|
26
|
+
},
|
|
27
|
+
SHUVI_SERVER_RUN_LOADERS: {
|
|
28
|
+
name: 'SHUVI_SERVER_RUN_LOADERS',
|
|
29
|
+
duration: true,
|
|
30
|
+
attrs: runLoadersAttrs
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
/** category SERVER_REQUEST */
|
|
35
|
+
exports.SERVER_REQUEST = {
|
|
36
|
+
name: 'SERVER_REQUEST',
|
|
37
|
+
events: {
|
|
38
|
+
SHUVI_SERVER_HANDLE_REQUEST_START: {
|
|
39
|
+
name: 'SHUVI_SERVER_HANDLE_REQUEST_START',
|
|
40
|
+
duration: false
|
|
41
|
+
},
|
|
42
|
+
SHUVI_SERVER_RUN_PAGE_MIDDLEWARE: {
|
|
43
|
+
name: 'SHUVI_SERVER_RUN_PAGE_MIDDLEWARE',
|
|
44
|
+
duration: true,
|
|
45
|
+
attrs: {
|
|
46
|
+
error: {
|
|
47
|
+
name: 'error',
|
|
48
|
+
type: 'boolean'
|
|
49
|
+
},
|
|
50
|
+
statusCode: {
|
|
51
|
+
name: 'statusCode',
|
|
52
|
+
type: 'number'
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
SHUVI_SERVER_RENDER_TO_STRING: {
|
|
57
|
+
name: 'SHUVI_SERVER_RENDER_TO_STRING',
|
|
58
|
+
duration: true,
|
|
59
|
+
attrs: {
|
|
60
|
+
error: {
|
|
61
|
+
name: 'error',
|
|
62
|
+
type: 'boolean'
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
SHUVI_SERVER_RENDER_TO_HTML: {
|
|
67
|
+
name: 'SHUVI_SERVER_RENDER_TO_HTML',
|
|
68
|
+
duration: true
|
|
69
|
+
},
|
|
70
|
+
SHUVI_SERVER_SEND_HTML_HOOK: {
|
|
71
|
+
name: 'SHUVI_SERVER_SEND_HTML_HOOK',
|
|
72
|
+
duration: true
|
|
73
|
+
},
|
|
74
|
+
SHUVI_SERVER_SEND_HTML_ORIGINAL: {
|
|
75
|
+
name: 'SHUVI_SERVER_SEND_HTML_ORIGINAL',
|
|
76
|
+
duration: true
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
/** category CLIENT_ENTRY */
|
|
81
|
+
exports.CLIENT_ENTRY = {
|
|
82
|
+
name: 'CLIENT_ENTRY',
|
|
83
|
+
events: {
|
|
84
|
+
SHUVI_CLIENT_ENTRY_START: {
|
|
85
|
+
name: 'SHUVI_CLIENT_ENTRY_START',
|
|
86
|
+
duration: false
|
|
87
|
+
},
|
|
88
|
+
SHUVI_CLIENT_SETUP_ENV: {
|
|
89
|
+
name: 'SHUVI_CLIENT_SETUP_ENV',
|
|
90
|
+
duration: true
|
|
91
|
+
},
|
|
92
|
+
SHUVI_CLIENT_CREATE_APP: {
|
|
93
|
+
name: 'SHUVI_CLIENT_CREATE_APP',
|
|
94
|
+
duration: true
|
|
95
|
+
},
|
|
96
|
+
SHUVI_CLIENT_APP_INIT: {
|
|
97
|
+
name: 'SHUVI_CLIENT_APP_INIT',
|
|
98
|
+
duration: true
|
|
99
|
+
},
|
|
100
|
+
SHUVI_CLIENT_RUN_APP: {
|
|
101
|
+
name: 'SHUVI_CLIENT_RUN_APP',
|
|
102
|
+
duration: true
|
|
103
|
+
},
|
|
104
|
+
SHUVI_CLIENT_DO_RENDER: {
|
|
105
|
+
name: 'SHUVI_CLIENT_DO_RENDER',
|
|
106
|
+
duration: true
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
const navigationAttrs = {
|
|
111
|
+
from: {
|
|
112
|
+
name: 'from',
|
|
113
|
+
type: 'string'
|
|
114
|
+
},
|
|
115
|
+
to: {
|
|
116
|
+
name: 'to',
|
|
117
|
+
type: 'string'
|
|
118
|
+
},
|
|
119
|
+
navigationId: {
|
|
120
|
+
name: 'navigationId',
|
|
121
|
+
type: 'string'
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
/** category CLIENT_RENDER */
|
|
125
|
+
exports.CLIENT_RENDER = {
|
|
126
|
+
name: 'CLIENT_RENDER',
|
|
127
|
+
events: {
|
|
128
|
+
SHUVI_PAGE_READY: {
|
|
129
|
+
name: 'SHUVI_PAGE_READY',
|
|
130
|
+
duration: false
|
|
131
|
+
},
|
|
132
|
+
SHUVI_NAVIGATION_TRIGGERED: {
|
|
133
|
+
name: 'SHUVI_NAVIGATION_TRIGGERED',
|
|
134
|
+
duration: true,
|
|
135
|
+
attrs: navigationAttrs
|
|
136
|
+
},
|
|
137
|
+
SHUVI_NAVIGATION_DONE: {
|
|
138
|
+
name: 'SHUVI_NAVIGATION_DONE',
|
|
139
|
+
duration: true,
|
|
140
|
+
attrs: navigationAttrs
|
|
141
|
+
},
|
|
142
|
+
SHUVI_CLIENT_RUN_LOADERS: {
|
|
143
|
+
name: 'SHUVI_CLIENT_RUN_LOADERS',
|
|
144
|
+
duration: true,
|
|
145
|
+
attrs: runLoadersAttrs
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare type SpanId = number;
|
|
2
|
+
export declare type traceData = {
|
|
3
|
+
timestamp: number;
|
|
4
|
+
name: string;
|
|
5
|
+
duration: number;
|
|
6
|
+
startTime: number;
|
|
7
|
+
endTime: number;
|
|
8
|
+
id: SpanId;
|
|
9
|
+
parentId?: SpanId;
|
|
10
|
+
attrs?: Object;
|
|
11
|
+
};
|
|
12
|
+
export declare type Reporter = (data: traceData) => void;
|
package/lib/reporter.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shuvi/shared",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.30",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/shuvijs/shuvi.git",
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
],
|
|
15
15
|
"sideEffects": false,
|
|
16
16
|
"exports": {
|
|
17
|
+
"./constants": {
|
|
18
|
+
"import": "./esm/constants/index.js",
|
|
19
|
+
"require": "./lib/constants/index.js"
|
|
20
|
+
},
|
|
17
21
|
"./*": {
|
|
18
22
|
"import": "./esm/*.js",
|
|
19
23
|
"require": "./lib/*.js"
|
|
@@ -33,6 +37,6 @@
|
|
|
33
37
|
"node": ">= 16.0.0"
|
|
34
38
|
},
|
|
35
39
|
"dependencies": {
|
|
36
|
-
"@shuvi/hook": "1.0.
|
|
40
|
+
"@shuvi/hook": "1.0.30"
|
|
37
41
|
}
|
|
38
42
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|