etrackp_temp 0.0.1

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 ADDED
@@ -0,0 +1,512 @@
1
+ # etrackp 前端埋点监控 SDK
2
+
3
+ [![JavaScript](https://img.shields.io/badge/JavaScript-ES6+-yellow.svg)](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript)
4
+ [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
5
+ [![Build](https://img.shields.io/badge/Gitee-Build-brightgreen?logo=gitee)](https://gitee.com/mccby/etrackp)
6
+
7
+ etrackp 是一个轻量级、高性能的前端行为与性能监控 SDK。它能够自动采集用户行为、页面性能、路由变化、HTTP 请求等数据,并提供灵活的上报机制和自定义扩展功能。
8
+
9
+ ## 📦 安装
10
+
11
+ ### 通过 NPM 安装
12
+ ```bash
13
+ npm install etrackp
14
+ ```
15
+
16
+ ### 通过 CDN 引入
17
+ ```html
18
+ <script src="https://cdn.example.com/etrackp.umd.js"></script>
19
+ ```
20
+
21
+ ### NPM 方式引入
22
+ ```javascript
23
+ import Etrackp from 'etrackp'
24
+ // 或
25
+ const Etrackp = require('etrackp');
26
+ ```
27
+
28
+ ## 🚀 快速开始
29
+
30
+ ### 1. 基础用法
31
+ ```javascript
32
+ // 创建监控实例
33
+ const tracker = new Etrackp({
34
+ url: 'https://your-api-domain.com/track' // 数据上报地址(必填)
35
+ });
36
+
37
+ // 初始化监控
38
+ tracker.init({
39
+ observe_router: true, // 监听路由变化
40
+ observe_http: true, // 监听 HTTP 请求
41
+ observe_click: true, // 监听点击事件
42
+ observe_performance: true, // 监听性能指标
43
+ user_id: 'optional_user_id' // 自定义用户 ID(可选)
44
+ });
45
+ ```
46
+
47
+ ### 2. 高级配置
48
+ ```javascript
49
+ const tracker = new Etrackp({
50
+ url: 'https://api.yourdomain.com/analytics'
51
+ });
52
+
53
+ // 设置自定义字段
54
+ tracker.setOptions({
55
+ project: 'website',
56
+ version: '2.1.0',
57
+ environment: 'production'
58
+ });
59
+
60
+ // 初始化监控
61
+ tracker.init({
62
+ observe_router: true,
63
+ observe_http: true,
64
+ observe_click: true,
65
+ observe_performance: true,
66
+ user_id: 'user_123456'
67
+ });
68
+
69
+ // 自定义事件上报
70
+ tracker.customReporting({
71
+ event: 'user_login',
72
+ login_method: 'email',
73
+ timestamp: Date.now()
74
+ });
75
+ ```
76
+
77
+ ## ✨ 核心功能
78
+
79
+ ### 🔄 路由监控
80
+ - 自动监听 `pushState` / `replaceState` API 调用
81
+ - 监听浏览器前进/后退操作
82
+ - 自动计算页面停留时间
83
+ - 支持 SPA(单页应用)路由变化追踪
84
+
85
+ ### 🌐 HTTP 请求监控
86
+ - 自动拦截 `XMLHttpRequest` 请求
87
+ - 自动拦截 `fetch` API 请求
88
+ - 记录请求方法、URL、请求体等信息
89
+ - 支持排除特定请求(通过 `etrackpNoRecord: true`)
90
+
91
+ ### 🖱️ 点击事件监控
92
+ - 全局点击事件监听
93
+ - 智能采集元素信息(标签名、类名、文本内容)
94
+ - 记录点击坐标位置
95
+ - 支持配置需要采集文本的标签类型
96
+
97
+ ### 📊 性能监控
98
+ - **FP(First Paint)**: 首次绘制时间
99
+ - **FCP(First Contentful Paint)**: 首次内容绘制时间
100
+ - **LCP(Largest Contentful Paint)**: 最大内容绘制时间及相关元素信息
101
+ - **DCL(DOMContentLoaded)**: DOM 加载完成时间
102
+ - **Load**: 页面完全加载时间
103
+ - **TTFB(Time to First Byte)**: 首字节时间
104
+
105
+ ### 👤 用户识别
106
+ - 自动生成 UUID(符合 RFC4122 标准)
107
+ - 支持自定义用户 ID
108
+ - 基于 localStorage 的持久化存储
109
+ - 跨会话用户身份保持
110
+
111
+ ### 📤 数据上报
112
+ - 智能缓存机制(默认 10 条批量上报)
113
+ - 页面卸载前自动上报剩余数据
114
+ - 支持自定义字段扩展
115
+ - 断网环境下数据持久化存储
116
+
117
+ ## 📖 API 参考
118
+
119
+ ### 构造函数
120
+ ```javascript
121
+ new Etrackp(options)
122
+ ```
123
+ **参数:**
124
+ - `options` (Object): 配置对象
125
+ - `url` (String, 必填): 数据上报地址例如 `'https://api.yourdomain.com/analytics'`
126
+
127
+ ### 方法
128
+
129
+ #### `init(observeConfig)`
130
+ 初始化监控器。
131
+
132
+ **参数:**
133
+ - `observeConfig` (Object): 监控配置
134
+ - `observe_router` (Boolean): 是否监控路由变化
135
+ - `observe_http` (Boolean): 是否监控 HTTP 请求
136
+ - `observe_click` (Boolean): 是否监控点击事件
137
+ - `observe_performance` (Boolean): 是否监控性能指标
138
+ - `user_id` (String, 可选): 自定义用户 ID
139
+
140
+ **示例:**
141
+ ```javascript
142
+ tracker.init({
143
+ observe_router: true,
144
+ observe_http: true,
145
+ observe_click: true,
146
+ observe_performance: true,
147
+ user_id: 'custom_user_id'
148
+ });
149
+ ```
150
+
151
+ #### `destroy()`
152
+ 销毁监控器,移除所有事件监听。
153
+
154
+ **示例:**
155
+ ```javascript
156
+ tracker.destroy();
157
+ ```
158
+
159
+ #### `customReporting(data)`
160
+ 上报自定义事件。
161
+
162
+ **参数:**
163
+ - `data` (Object): 事件数据对象,必须包含 `event` 字段
164
+
165
+ **示例:**
166
+ ```javascript
167
+ tracker.customReporting({
168
+ event: 'video_play',
169
+ video_id: '12345',
170
+ duration: 120,
171
+ play_type: 'auto'
172
+ });
173
+ ```
174
+
175
+ #### `setOptions(data)`
176
+ 设置自定义字段或更新用户 ID。
177
+
178
+ **参数:**
179
+ - `data` (Object): 配置数据对象
180
+ - `user_id` (String, 可选): 更新用户 ID
181
+ - 其他自定义字段
182
+
183
+ **示例:**
184
+ ```javascript
185
+ tracker.setOptions({
186
+ user_id: 'new_user_id',
187
+ project: 'ecommerce',
188
+ page_type: 'product_detail',
189
+ utm_source: 'google_ads'
190
+ });
191
+ ```
192
+
193
+ #### `removeOptions(key)`
194
+ 移除已添加的自定义字段
195
+
196
+ **参数:**
197
+ - `key` (String, 必填): 要移除的字段
198
+
199
+ **示例:**
200
+ ```javascript
201
+ tracker.removeOptions('your-custom-key');
202
+ ```
203
+
204
+ ## 📊 数据格式说明
205
+
206
+ ### 通用字段
207
+ 所有上报数据都包含以下基础字段:
208
+
209
+ | 字段名 | 类型 | 说明 |
210
+ |--------|------|------|
211
+ | `origin` | String | 页面来源(协议+域名+端口) |
212
+ | `uuid` | String | 用户唯一标识 |
213
+ | `screen_height` | Number | 屏幕高度(像素) |
214
+ | `scrollTop` | Number | 页面滚动位置 |
215
+ | `timestamp` | Number | 触发时的时间戳 |
216
+ | `custom_reporting` | Boolean | 是否为自定义上报 |
217
+ | `custom_field` | Object | 自定义字段集合 |
218
+ | `event` | String | 事件类型标识 |
219
+
220
+ ### 事件类型及字段
221
+
222
+ #### 1. 点击事件 (`elementClick`)
223
+ | 字段 | 类型 | 说明 |
224
+ |------|------|------|
225
+ | `nodeType` | Number | DOM 节点类型 |
226
+ | `tagName` | String | 元素标签名(小写) |
227
+ | `className` | String | 元素类名 |
228
+ | `textContent` | String | 元素文本内容(仅限配置的标签类型) |
229
+ | `clientX` | Number | 点击位置 X 坐标 |
230
+ | `clientY` | Number | 点击位置 Y 坐标 |
231
+ | `href` | String | 当前页面完整 URL |
232
+
233
+ #### 2. 路由变化 (`routerChange`)
234
+ | 字段 | 类型 | 说明 |
235
+ |------|------|------|
236
+ | `type` | String | 路由变化类型:`pushState`、`replaceState`、`forwardOrBack` |
237
+ | `from` | String | 来源路径(相对路径) |
238
+ | `to` | String | 目标路径(相对路径) |
239
+
240
+ #### 3. 停留时间 (`dwellTime`)
241
+ | 字段 | 类型 | 说明 |
242
+ |------|------|------|
243
+ | `href` | String | 页面路径(相对路径) |
244
+ | `stay_ms` | Number | 停留时间(毫秒) |
245
+
246
+ #### 4. HTTP 请求
247
+ **XMLHttpRequest (`reuqest_XMLHttpRequest`)**:
248
+ | 字段 | 类型 | 说明 |
249
+ |------|------|------|
250
+ | `url` | String | 请求 URL |
251
+ | `method` | String | 请求方法 |
252
+ | `body` | Object | 请求体数据 |
253
+
254
+ **Fetch (`reuqest_fetch`)**:
255
+ | 字段 | 类型 | 说明 |
256
+ |------|------|------|
257
+ | `url` | String | 请求 URL |
258
+ | `method` | String | 请求方法 |
259
+ | `credentials` | String | 凭证模式 |
260
+ | `headers` | Object | 请求头 |
261
+ | `params` | Object | URL 参数 |
262
+ | `timeout` | Number | 超时时间 |
263
+
264
+ #### 5. 性能指标 (`page_performance`)
265
+ | 字段 | 类型 | 说明 |
266
+ |------|------|------|
267
+ | `FP` | Number | 首次绘制时间(毫秒) |
268
+ | `FP_URL` | String | FP 发生时的页面 URL |
269
+ | `FCP` | Number | 首次内容绘制时间(毫秒) |
270
+ | `DCL` | Number | DOMContentLoaded 时间(毫秒) |
271
+ | `Load` | Number | 页面加载完成时间(毫秒) |
272
+ | `TTFB` | Number | 首字节时间(毫秒) |
273
+ | `LCP` | Number | 最大内容绘制时间(毫秒) |
274
+ | `tagName` | String | LCP 对应元素的标签名 |
275
+ | `textContent` | String | LCP 对应元素的文本内容 |
276
+
277
+ ## ⚙️ 配置选项
278
+
279
+ ### 默认配置
280
+ ```javascript
281
+ // SDK 内部默认值
282
+ {
283
+ #hasTextTags: ['button', 'span', 'a'], // 需要采集文本的标签类型
284
+ #url: '', // 上报地址-必填
285
+ #uuidTemplate: 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx' // UUID 模板
286
+ }
287
+ ```
288
+
289
+ ### 性能优化建议
290
+ 1. **按需启用监控**:只启用需要的监控功能
291
+ 2. **自定义上报频率**:调整上报阈值(修改代码中的 `old_str_arr.length > 10`)
292
+ 3. **数据脱敏**:通过 `setOptions` 设置自定义字段进行数据脱敏
293
+ 4. **排除敏感请求**:在 fetch 请求中添加 `etrackpNoRecord: true`
294
+
295
+ ## 🔧 集成示例
296
+
297
+ ### Vue.js 集成
298
+ ```javascript
299
+ // main.js
300
+ import etrackp from 'etrackp';
301
+
302
+ const tracker = new Etrackp({
303
+ url: process.env.VUE_APP_TRACK_URL
304
+ });
305
+
306
+ // 设置项目信息
307
+ tracker.setOptions({
308
+ project: 'vue-app',
309
+ version: process.env.VUE_APP_VERSION
310
+ });
311
+
312
+ // 初始化监控
313
+ tracker.init({
314
+ observe_router: true,
315
+ observe_http: false,
316
+ observe_click: true,
317
+ observe_performance: true
318
+ });
319
+
320
+ // 挂载到 Vue 实例
321
+ Vue.prototype.$tracker = tracker;
322
+ ```
323
+
324
+ ### React 集成
325
+ ```javascript
326
+ // tracker.js
327
+ import etrackp from 'etrackp';
328
+
329
+ class Tracker {
330
+ constructor() {
331
+ this.tracker = new Etrackp({
332
+ url: process.env.REACT_APP_TRACK_URL
333
+ });
334
+
335
+ this.tracker.setOptions({
336
+ project: 'react-app',
337
+ version: process.env.REACT_APP_VERSION
338
+ });
339
+ }
340
+
341
+ init() {
342
+ this.tracker.init({
343
+ observe_router: true,
344
+ observe_http: true,
345
+ observe_click: true,
346
+ observe_performance: true
347
+ });
348
+ }
349
+
350
+ // 封装自定义事件
351
+ trackEvent(eventName, properties) {
352
+ this.tracker.customReporting({
353
+ event: eventName,
354
+ ...properties,
355
+ timestamp: Date.now()
356
+ });
357
+ }
358
+ }
359
+
360
+ export default new Tracker();
361
+
362
+ // App.js
363
+ import tracker from './tracker';
364
+ import { useEffect } from 'react';
365
+
366
+ function App() {
367
+ useEffect(() => {
368
+ tracker.init();
369
+
370
+ // 组件卸载时销毁
371
+ return () => {
372
+ tracker.tracker.destroy();
373
+ };
374
+ }, []);
375
+
376
+ // 使用示例
377
+ const handleButtonClick = () => {
378
+ tracker.trackEvent('button_click', {
379
+ button_id: 'submit_btn',
380
+ page: 'home'
381
+ });
382
+ };
383
+ }
384
+ ```
385
+
386
+ ## 📈 数据处理建议
387
+
388
+ ### 后端接收示例(Node.js)
389
+ ```javascript
390
+ const express = require('express');
391
+ const app = express();
392
+
393
+ app.use(express.json({ limit: '10mb' }));
394
+
395
+ app.post('/track', (req, res) => {
396
+ const trackData = req.body;
397
+
398
+ // 1. 数据验证
399
+ if (!Array.isArray(trackData)) {
400
+ return res.status(400).json({ error: 'Invalid data format' });
401
+ }
402
+
403
+ // 2. 数据处理
404
+ trackData.forEach(item => {
405
+ // 添加服务器时间戳
406
+ item.server_timestamp = Date.now();
407
+
408
+ // 数据脱敏(示例)
409
+ if (item.event === 'elementClick' && item.textContent) {
410
+ item.textContent = item.textContent.substring(0, 100); // 截断长文本
411
+ }
412
+
413
+ // 存储到数据库或消息队列
414
+ saveToDatabase(item);
415
+ });
416
+
417
+ res.status(200).json({ success: true, count: trackData.length });
418
+ });
419
+
420
+ function saveToDatabase(data) {
421
+ // 实现数据存储逻辑
422
+ console.log('Storing data:', data.event, data.uuid);
423
+ }
424
+ ```
425
+
426
+ ## ⚠️ 注意事项
427
+
428
+ ### 1. 隐私合规
429
+ - **GDPR/CCPA 合规**:确保用户同意后再启用监控
430
+ - **数据脱敏**:避免采集敏感信息(密码、身份证号等)
431
+ - **用户告知**:在隐私政策中说明数据采集范围
432
+
433
+ ### 2. 性能影响
434
+ - **内存使用**:本地缓存可能占用 localStorage 空间
435
+ - **网络请求**:批量上报可能增加网络负载
436
+ - **事件监听**:大量事件监听可能影响页面性能
437
+
438
+ ### 3. 浏览器兼容性
439
+ - **现代浏览器**:Chrome 60+、Firefox 55+、Safari 11+、Edge 79+
440
+ - **API 依赖**:需要支持 `localStorage`、`fetch`、`PerformanceObserver`
441
+ - **Polyfill**:如需支持旧版浏览器,可能需要添加 polyfill
442
+
443
+ ### 4. 数据安全
444
+ - **HTTPS**:确保上报地址使用 HTTPS
445
+ - **数据加密**:敏感数据建议加密后再上报
446
+ - **访问控制**:后端接口应设置合理的访问控制
447
+
448
+ ## 🐛 故障排除
449
+
450
+ ### 常见问题
451
+
452
+ #### Q1: 数据没有上报
453
+ - 检查网络连接
454
+ - 验证上报地址是否正确
455
+ - 查看浏览器控制台是否有错误
456
+ - 检查 localStorage 是否被禁用
457
+
458
+ #### Q2: 性能指标不准确
459
+ - 确保在页面加载早期初始化 SDK
460
+ - 检查浏览器是否支持 PerformanceObserver API
461
+ - 验证页面是否为 SPA(单页应用)
462
+
463
+ #### Q3: 点击事件没有文本内容
464
+ - 确认点击元素是否为配置的标签类型(button、span、a)
465
+ - 检查元素是否有文本内容
466
+ - 验证事件监听是否正确绑定
467
+
468
+ #### Q4: 路由监控不工作
469
+ - 确认是否启用了 `observe_router`
470
+ - 检查是否为 History API 路由
471
+ - 验证是否在路由库初始化前调用了 `init()`
472
+
473
+ ### 调试模式
474
+ ```javascript
475
+ // 在开发环境中启用详细日志
476
+ if (process.env.NODE_ENV === 'development') {
477
+ // 监听 localStorage 变化查看上报数据
478
+ window.addEventListener('storage', (e) => {
479
+ if (e.key === 'etrackp_data') {
480
+ console.log('Track data:', JSON.parse(e.newValue || '[]'));
481
+ }
482
+ });
483
+ }
484
+ ```
485
+
486
+ ## 📄 许可证
487
+
488
+ MIT License
489
+
490
+ Copyright (c) 2024 etrackp
491
+
492
+ ## 🤝 贡献指南
493
+
494
+ 欢迎提交 Issue 和 Pull Request!
495
+
496
+ 1. Fork 项目
497
+ 2. 创建功能分支 (`git checkout -b feature/AmazingFeature`)
498
+ 3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)
499
+ 4. 推送到分支 (`git push origin feature/AmazingFeature`)
500
+ 5. 开启 Pull Request
501
+
502
+ ## 📞 支持与反馈
503
+
504
+ - 提交 Issue: [Gitee Issues](https://gitee.com/mccby/etrackp/issues)
505
+ - 文档更新: 欢迎改进本文档
506
+ - 功能建议: 通过 Issue 提出新功能建议
507
+
508
+ ---
509
+
510
+ **版本**: 0.0.1
511
+ **最后更新**: 2025-12-24
512
+ **维护者**: etrackp Team
@@ -0,0 +1 @@
1
+ "use strict";function e(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function t(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function n(t,n){return t.get(e(t,n))}function r(e,n,r){t(e,n),n.set(e,r)}function o(t,n,r){return t.set(e(t,n),r),r}function i(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach(function(t){a(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function s(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}var u=new WeakMap,h=new WeakMap,p=new WeakMap,d=new WeakMap,f=new WeakMap,w=new WeakMap,v=new WeakMap,m=new WeakMap,y=new WeakMap,g=new WeakMap,b=new WeakMap,k=new WeakSet,x=new WeakMap,O=new WeakMap,_=new WeakMap,M=new WeakMap,S=new WeakMap,j=function(){return i(function e(i){var a,c,s=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t(a=this,c=k),c.add(a),r(this,u,["button","span","a"]),r(this,h,""),r(this,p,"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"),r(this,d,{}),r(this,f,{}),r(this,w,{event:"page_performance"}),r(this,v,""),r(this,m,""),r(this,y,{}),r(this,g,!1),r(this,b,!1),r(this,x,function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=window.localStorage.getItem("etrackp_data")||"[]",a=JSON.parse(i);if(e){var c=document.body.scrollTop||document.documentElement.scrollTop,u=l(l({},e),{},{origin:window.location.origin,uuid:n(v,s),screen_height:window.screen.height,scrollTop:c,timestamp:+new Date,custom_reporting:t,custom_field:l({},n(d,s))});a.push(u)}var p=JSON.stringify(a);if(window.localStorage.setItem("etrackp_data",p),!n(g,s)&&a.length>10||r){if(0==a.length||!n(h,s))return;o(g,s,!0),fetch(n(h,s),{method:"post",body:p,etrackpNoRecord:!0}).then(function(e){var t=window.localStorage.getItem("etrackp_data")||"[]",n=p.replace(/\[|\]/g,"");t=t.replace(n,"").replace(/^\[,/,"[").replace(/\,]$/,"]"),window.localStorage.setItem("etrackp_data",t)}).finally(function(){o(g,s,!1)})}}),r(this,O,function(e){var t=document.elementFromPoint(e.clientX,e.clientY),r=t.tagName.toLocaleLowerCase();n(x,s).call(s,{event:"elementClick",nodeType:t.nodeType,tagName:r,className:t.className,textContent:n(u,s).includes(r)?t.textContent:"",clientX:e.clientX,clientY:e.clientY,href:window.location.href.replace(origin,"")})}),r(this,_,function(e){var t=window.location,r=t.origin,i=t.href;n(y,s)[n(m,s)]&&n(x,s).call(s,{event:"dwellTime",href:n(m,s),stay_ms:+new Date-n(y,s)[n(m,s)]}),n(y,s)[i]=+new Date,o(m,s,i.replace(r,"")),n(x,s).call(s,{event:"routerChange",type:"forwardOrBack",from:n(m,s),to:i.replace(r,"")})}),r(this,M,function(e,t){var r=t.replace(window.location.origin,"");n(y,s)[n(m,s)]&&n(x,s).call(s,{event:"dwellTime",href:n(m,s),stay_ms:+new Date-n(y,s)[n(m,s)]}),n(x,s).call(s,{event:"routerChange",from:n(m,s),to:r,type:e}),n(y,s)[r]=+new Date,o(m,s,r)}),r(this,S,function(){n(x,s).call(s,null,!1,!0)}),o(h,this,(null==i?void 0:i.url)||""),o(m,this,window.location.href.replace(window.location.origin,"")),n(y,this)[n(m,this)]=+new Date},[{key:"init",value:function(t){t.observe_router&&(window.addEventListener("popstate",n(_,this)),e(k,this,P).call(this,this)),t.observe_http&&(e(k,this,L).call(this,this),e(k,this,T).call(this,this)),t.observe_click&&document.addEventListener("click",n(O,this)),t.observe_performance&&(e(k,this,W).call(this),e(k,this,C).call(this),e(k,this,D).call(this)),e(k,this,E).call(this,t.user_id),window.addEventListener("beforeunload",n(S,this)),o(f,this,t)}},{key:"destroy",value:function(){o(b,this,!0),n(f,this).observe_router&&window.removeEventListener("popstate",n(_,this)),n(f,this).observe_click&&document.removeEventListener("click",n(O,this)),window.removeEventListener("beforeunload",n(S,this))}},{key:"customReporting",value:function(e){e.event&&n(x,this).call(this,e,!0)}},{key:"setOptions",value:function(t){"[object Object]"==Object.prototype.toString.call(t)&&(t.user_id&&(e(k,this,E).call(this,t.user_id),delete t.user_id),o(d,this,t))}},{key:"removeOptions",value:function(e){e&&delete n(d,this)[e]}}])}();function E(e){if(e)return o(v,this,e),void window.localStorage.setItem("etrackp_uuid",e);var t=window.localStorage.getItem("etrackp_uuid");t?o(v,this,t):(o(v,this,n(p,this).replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),window.localStorage.setItem("etrackp_uuid",n(v,this)))}function P(e){var t=window.history.pushState,r=window.history.replaceState;window.history.pushState=function(r,o,i){return n(M,e).call(e,"pushState",i),t.call(this,r,o,i)},window.history.replaceState=function(t,o,i){return n(M,e).call(e,"replaceState",i),r.call(this,t,o,i)}}function L(e){var t=XMLHttpRequest.prototype.open,r=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function(e,n){return this._method=e,this._url=n,t.apply(this,arguments)},XMLHttpRequest.prototype.send=function(t){return n(b,e)||n(x,e).call(e,{event:"reuqest_XMLHttpRequest",url:this._url,method:this._method,body:t||{}}),r.apply(this,arguments)}}function T(e){try{var t=window.fetch;window.fetch=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];var a=o[1];return a.etrackpNoRecord||n(b,e)||n(x,e).call(e,{event:"reuqest_fetch",url:o[0],credentials:a.credentials,data:a.data||{},headers:a.headers,interceptors:a.interceptors,method:a.method,params:a.params,timeout:a.timeout}),t.apply(this,o)}}catch(e){}}function W(){var e=this,t=new PerformanceObserver(function(t){t.getEntries().forEach(function(t){"first-paint"===t.name&&(n(w,e).FP=Math.round(t.startTime)),"first-contentful-paint"===t.name&&(n(w,e).FCP=Math.round(t.startTime))})});null==t||t.observe({type:"paint",buffered:!0})}function C(){var e=this,t=new PerformanceObserver(function(t){var r,o,i=t.getEntries(),a=i[i.length-1];n(w,e).LCP=Math.round(a.renderTime||a.loadTime),n(w,e).tagName=(null===(r=a.element)||void 0===r||null===(r=r.tagName)||void 0===r?void 0:r.toLocaleLowerCase())||"",n(w,e).textContent=(null===(o=a.element)||void 0===o?void 0:o.textContent)||""});null==t||t.observe({type:"largest-contentful-paint",buffered:!0})}function D(){var e=this,t=new PerformanceObserver(function(t){var r=t.getEntries(),o=r[r.length-1];n(w,e).DCL=Math.round(o.domContentLoadedEventEnd),n(w,e).Load=Math.round(o.loadEventEnd),n(w,e).TTFB=Math.round(o.responseStart),n(w,e).href=window.location.href.replace(window.location.origin,""),n(x,e).call(e,n(w,e))});null==t||t.observe({type:"navigation",buffered:!0})}module.exports=j;
@@ -0,0 +1 @@
1
+ function e(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function t(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function n(t,n){return t.get(e(t,n))}function r(e,n,r){t(e,n),n.set(e,r)}function o(t,n,r){return t.set(e(t,n),r),r}function i(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach(function(t){a(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function s(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}var u=new WeakMap,h=new WeakMap,p=new WeakMap,d=new WeakMap,f=new WeakMap,w=new WeakMap,v=new WeakMap,m=new WeakMap,y=new WeakMap,g=new WeakMap,b=new WeakMap,k=new WeakSet,x=new WeakMap,O=new WeakMap,_=new WeakMap,M=new WeakMap,S=new WeakMap,j=function(){return i(function e(i){var a,c,s=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t(a=this,c=k),c.add(a),r(this,u,["button","span","a"]),r(this,h,""),r(this,p,"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"),r(this,d,{}),r(this,f,{}),r(this,w,{event:"page_performance"}),r(this,v,""),r(this,m,""),r(this,y,{}),r(this,g,!1),r(this,b,!1),r(this,x,function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=window.localStorage.getItem("etrackp_data")||"[]",a=JSON.parse(i);if(e){var c=document.body.scrollTop||document.documentElement.scrollTop,u=l(l({},e),{},{origin:window.location.origin,uuid:n(v,s),screen_height:window.screen.height,scrollTop:c,timestamp:+new Date,custom_reporting:t,custom_field:l({},n(d,s))});a.push(u)}var p=JSON.stringify(a);if(window.localStorage.setItem("etrackp_data",p),!n(g,s)&&a.length>10||r){if(0==a.length||!n(h,s))return;o(g,s,!0),fetch(n(h,s),{method:"post",body:p,etrackpNoRecord:!0}).then(function(e){var t=window.localStorage.getItem("etrackp_data")||"[]",n=p.replace(/\[|\]/g,"");t=t.replace(n,"").replace(/^\[,/,"[").replace(/\,]$/,"]"),window.localStorage.setItem("etrackp_data",t)}).finally(function(){o(g,s,!1)})}}),r(this,O,function(e){var t=document.elementFromPoint(e.clientX,e.clientY),r=t.tagName.toLocaleLowerCase();n(x,s).call(s,{event:"elementClick",nodeType:t.nodeType,tagName:r,className:t.className,textContent:n(u,s).includes(r)?t.textContent:"",clientX:e.clientX,clientY:e.clientY,href:window.location.href.replace(origin,"")})}),r(this,_,function(e){var t=window.location,r=t.origin,i=t.href;n(y,s)[n(m,s)]&&n(x,s).call(s,{event:"dwellTime",href:n(m,s),stay_ms:+new Date-n(y,s)[n(m,s)]}),n(y,s)[i]=+new Date,o(m,s,i.replace(r,"")),n(x,s).call(s,{event:"routerChange",type:"forwardOrBack",from:n(m,s),to:i.replace(r,"")})}),r(this,M,function(e,t){var r=t.replace(window.location.origin,"");n(y,s)[n(m,s)]&&n(x,s).call(s,{event:"dwellTime",href:n(m,s),stay_ms:+new Date-n(y,s)[n(m,s)]}),n(x,s).call(s,{event:"routerChange",from:n(m,s),to:r,type:e}),n(y,s)[r]=+new Date,o(m,s,r)}),r(this,S,function(){n(x,s).call(s,null,!1,!0)}),o(h,this,(null==i?void 0:i.url)||""),o(m,this,window.location.href.replace(window.location.origin,"")),n(y,this)[n(m,this)]=+new Date},[{key:"init",value:function(t){t.observe_router&&(window.addEventListener("popstate",n(_,this)),e(k,this,P).call(this,this)),t.observe_http&&(e(k,this,L).call(this,this),e(k,this,T).call(this,this)),t.observe_click&&document.addEventListener("click",n(O,this)),t.observe_performance&&(e(k,this,W).call(this),e(k,this,C).call(this),e(k,this,D).call(this)),e(k,this,E).call(this,t.user_id),window.addEventListener("beforeunload",n(S,this)),o(f,this,t)}},{key:"destroy",value:function(){o(b,this,!0),n(f,this).observe_router&&window.removeEventListener("popstate",n(_,this)),n(f,this).observe_click&&document.removeEventListener("click",n(O,this)),window.removeEventListener("beforeunload",n(S,this))}},{key:"customReporting",value:function(e){e.event&&n(x,this).call(this,e,!0)}},{key:"setOptions",value:function(t){"[object Object]"==Object.prototype.toString.call(t)&&(t.user_id&&(e(k,this,E).call(this,t.user_id),delete t.user_id),o(d,this,t))}},{key:"removeOptions",value:function(e){e&&delete n(d,this)[e]}}])}();function E(e){if(e)return o(v,this,e),void window.localStorage.setItem("etrackp_uuid",e);var t=window.localStorage.getItem("etrackp_uuid");t?o(v,this,t):(o(v,this,n(p,this).replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),window.localStorage.setItem("etrackp_uuid",n(v,this)))}function P(e){var t=window.history.pushState,r=window.history.replaceState;window.history.pushState=function(r,o,i){return n(M,e).call(e,"pushState",i),t.call(this,r,o,i)},window.history.replaceState=function(t,o,i){return n(M,e).call(e,"replaceState",i),r.call(this,t,o,i)}}function L(e){var t=XMLHttpRequest.prototype.open,r=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function(e,n){return this._method=e,this._url=n,t.apply(this,arguments)},XMLHttpRequest.prototype.send=function(t){return n(b,e)||n(x,e).call(e,{event:"reuqest_XMLHttpRequest",url:this._url,method:this._method,body:t||{}}),r.apply(this,arguments)}}function T(e){try{var t=window.fetch;window.fetch=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];var a=o[1];return a.etrackpNoRecord||n(b,e)||n(x,e).call(e,{event:"reuqest_fetch",url:o[0],credentials:a.credentials,data:a.data||{},headers:a.headers,interceptors:a.interceptors,method:a.method,params:a.params,timeout:a.timeout}),t.apply(this,o)}}catch(e){}}function W(){var e=this,t=new PerformanceObserver(function(t){t.getEntries().forEach(function(t){"first-paint"===t.name&&(n(w,e).FP=Math.round(t.startTime)),"first-contentful-paint"===t.name&&(n(w,e).FCP=Math.round(t.startTime))})});null==t||t.observe({type:"paint",buffered:!0})}function C(){var e=this,t=new PerformanceObserver(function(t){var r,o,i=t.getEntries(),a=i[i.length-1];n(w,e).LCP=Math.round(a.renderTime||a.loadTime),n(w,e).tagName=(null===(r=a.element)||void 0===r||null===(r=r.tagName)||void 0===r?void 0:r.toLocaleLowerCase())||"",n(w,e).textContent=(null===(o=a.element)||void 0===o?void 0:o.textContent)||""});null==t||t.observe({type:"largest-contentful-paint",buffered:!0})}function D(){var e=this,t=new PerformanceObserver(function(t){var r=t.getEntries(),o=r[r.length-1];n(w,e).DCL=Math.round(o.domContentLoadedEventEnd),n(w,e).Load=Math.round(o.loadEventEnd),n(w,e).TTFB=Math.round(o.responseStart),n(w,e).href=window.location.href.replace(window.location.origin,""),n(x,e).call(e,n(w,e))});null==t||t.observe({type:"navigation",buffered:!0})}export{j as default};
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Etrackp=t()}(this,function(){"use strict";function e(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function t(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function n(t,n){return t.get(e(t,n))}function r(e,n,r){t(e,n),n.set(e,r)}function o(t,n,r){return t.set(e(t,n),r),r}function i(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach(function(t){a(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function s(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}var u=new WeakMap,h=new WeakMap,p=new WeakMap,d=new WeakMap,f=new WeakMap,w=new WeakMap,v=new WeakMap,m=new WeakMap,y=new WeakMap,g=new WeakMap,b=new WeakMap,k=new WeakSet,x=new WeakMap,O=new WeakMap,_=new WeakMap,M=new WeakMap,S=new WeakMap,j=function(){return i(function e(i){var a,c,s=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t(a=this,c=k),c.add(a),r(this,u,["button","span","a"]),r(this,h,""),r(this,p,"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"),r(this,d,{}),r(this,f,{}),r(this,w,{event:"page_performance"}),r(this,v,""),r(this,m,""),r(this,y,{}),r(this,g,!1),r(this,b,!1),r(this,x,function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=window.localStorage.getItem("etrackp_data")||"[]",a=JSON.parse(i);if(e){var c=document.body.scrollTop||document.documentElement.scrollTop,u=l(l({},e),{},{origin:window.location.origin,uuid:n(v,s),screen_height:window.screen.height,scrollTop:c,timestamp:+new Date,custom_reporting:t,custom_field:l({},n(d,s))});a.push(u)}var p=JSON.stringify(a);if(window.localStorage.setItem("etrackp_data",p),!n(g,s)&&a.length>10||r){if(0==a.length||!n(h,s))return;o(g,s,!0),fetch(n(h,s),{method:"post",body:p,etrackpNoRecord:!0}).then(function(e){var t=window.localStorage.getItem("etrackp_data")||"[]",n=p.replace(/\[|\]/g,"");t=t.replace(n,"").replace(/^\[,/,"[").replace(/\,]$/,"]"),window.localStorage.setItem("etrackp_data",t)}).finally(function(){o(g,s,!1)})}}),r(this,O,function(e){var t=document.elementFromPoint(e.clientX,e.clientY),r=t.tagName.toLocaleLowerCase();n(x,s).call(s,{event:"elementClick",nodeType:t.nodeType,tagName:r,className:t.className,textContent:n(u,s).includes(r)?t.textContent:"",clientX:e.clientX,clientY:e.clientY,href:window.location.href.replace(origin,"")})}),r(this,_,function(e){var t=window.location,r=t.origin,i=t.href;n(y,s)[n(m,s)]&&n(x,s).call(s,{event:"dwellTime",href:n(m,s),stay_ms:+new Date-n(y,s)[n(m,s)]}),n(y,s)[i]=+new Date,o(m,s,i.replace(r,"")),n(x,s).call(s,{event:"routerChange",type:"forwardOrBack",from:n(m,s),to:i.replace(r,"")})}),r(this,M,function(e,t){var r=t.replace(window.location.origin,"");n(y,s)[n(m,s)]&&n(x,s).call(s,{event:"dwellTime",href:n(m,s),stay_ms:+new Date-n(y,s)[n(m,s)]}),n(x,s).call(s,{event:"routerChange",from:n(m,s),to:r,type:e}),n(y,s)[r]=+new Date,o(m,s,r)}),r(this,S,function(){n(x,s).call(s,null,!1,!0)}),o(h,this,(null==i?void 0:i.url)||""),o(m,this,window.location.href.replace(window.location.origin,"")),n(y,this)[n(m,this)]=+new Date},[{key:"init",value:function(t){t.observe_router&&(window.addEventListener("popstate",n(_,this)),e(k,this,P).call(this,this)),t.observe_http&&(e(k,this,L).call(this,this),e(k,this,T).call(this,this)),t.observe_click&&document.addEventListener("click",n(O,this)),t.observe_performance&&(e(k,this,W).call(this),e(k,this,C).call(this),e(k,this,D).call(this)),e(k,this,E).call(this,t.user_id),window.addEventListener("beforeunload",n(S,this)),o(f,this,t)}},{key:"destroy",value:function(){o(b,this,!0),n(f,this).observe_router&&window.removeEventListener("popstate",n(_,this)),n(f,this).observe_click&&document.removeEventListener("click",n(O,this)),window.removeEventListener("beforeunload",n(S,this))}},{key:"customReporting",value:function(e){e.event&&n(x,this).call(this,e,!0)}},{key:"setOptions",value:function(t){"[object Object]"==Object.prototype.toString.call(t)&&(t.user_id&&(e(k,this,E).call(this,t.user_id),delete t.user_id),o(d,this,t))}},{key:"removeOptions",value:function(e){e&&delete n(d,this)[e]}}])}();function E(e){if(e)return o(v,this,e),void window.localStorage.setItem("etrackp_uuid",e);var t=window.localStorage.getItem("etrackp_uuid");t?o(v,this,t):(o(v,this,n(p,this).replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),window.localStorage.setItem("etrackp_uuid",n(v,this)))}function P(e){var t=window.history.pushState,r=window.history.replaceState;window.history.pushState=function(r,o,i){return n(M,e).call(e,"pushState",i),t.call(this,r,o,i)},window.history.replaceState=function(t,o,i){return n(M,e).call(e,"replaceState",i),r.call(this,t,o,i)}}function L(e){var t=XMLHttpRequest.prototype.open,r=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function(e,n){return this._method=e,this._url=n,t.apply(this,arguments)},XMLHttpRequest.prototype.send=function(t){return n(b,e)||n(x,e).call(e,{event:"reuqest_XMLHttpRequest",url:this._url,method:this._method,body:t||{}}),r.apply(this,arguments)}}function T(e){try{var t=window.fetch;window.fetch=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];var a=o[1];return a.etrackpNoRecord||n(b,e)||n(x,e).call(e,{event:"reuqest_fetch",url:o[0],credentials:a.credentials,data:a.data||{},headers:a.headers,interceptors:a.interceptors,method:a.method,params:a.params,timeout:a.timeout}),t.apply(this,o)}}catch(e){}}function W(){var e=this,t=new PerformanceObserver(function(t){t.getEntries().forEach(function(t){"first-paint"===t.name&&(n(w,e).FP=Math.round(t.startTime)),"first-contentful-paint"===t.name&&(n(w,e).FCP=Math.round(t.startTime))})});null==t||t.observe({type:"paint",buffered:!0})}function C(){var e=this,t=new PerformanceObserver(function(t){var r,o,i=t.getEntries(),a=i[i.length-1];n(w,e).LCP=Math.round(a.renderTime||a.loadTime),n(w,e).tagName=(null===(r=a.element)||void 0===r||null===(r=r.tagName)||void 0===r?void 0:r.toLocaleLowerCase())||"",n(w,e).textContent=(null===(o=a.element)||void 0===o?void 0:o.textContent)||""});null==t||t.observe({type:"largest-contentful-paint",buffered:!0})}function D(){var e=this,t=new PerformanceObserver(function(t){var r=t.getEntries(),o=r[r.length-1];n(w,e).DCL=Math.round(o.domContentLoadedEventEnd),n(w,e).Load=Math.round(o.loadEventEnd),n(w,e).TTFB=Math.round(o.responseStart),n(w,e).href=window.location.href.replace(window.location.origin,""),n(x,e).call(e,n(w,e))});null==t||t.observe({type:"navigation",buffered:!0})}return j});
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "etrackp_temp",
3
+ "author": "machengcheng <mchengcheng@126.com>",
4
+ "version": "0.0.1",
5
+ "description": "etrackp 是一个轻量级、高性能的前端行为与性能监控 SDK。",
6
+ "keywords": [
7
+ "event",
8
+ "click",
9
+ "fetch",
10
+ "XMLHttpRequest",
11
+ "router",
12
+ "PerformanceObserver"
13
+ ],
14
+ "private": false,
15
+ "type": "module",
16
+ "main": "./dist/etrackp.esm.js",
17
+ "unpkg": "./dist/etrackp.umd.js",
18
+ "exports": {
19
+ ".": {
20
+ "require": "./dist/etrackp.cjs",
21
+ "import": "./dist/etrackp.esm.js",
22
+ "default": "./dist/etrackp.esm.js"
23
+ }
24
+ },
25
+ "files": [
26
+ "dist"
27
+ ],
28
+ "scripts": {
29
+ "build": "npx rollup -c rollup.config.mjs",
30
+ "test": "test"
31
+ },
32
+ "homepage": "https://www.mccby.com",
33
+ "bugs": {
34
+ "url": "https://gitee.com/mccby/etrackp/issues"
35
+ },
36
+ "license": "Apache-2.0",
37
+ "repository": {
38
+ "type": "gitee",
39
+ "url": "https://gitee.com/mccby/etrackp"
40
+ },
41
+ "dependencies": {
42
+ "@babel/core": "^7.28.5",
43
+ "@babel/preset-env": "^7.28.5",
44
+ "@rollup/plugin-babel": "^6.1.0",
45
+ "rollup": "^4.54.0",
46
+ "rollup-plugin-terser": "^7.0.2"
47
+ }
48
+ }