fix: rn-log ErrorCapture 类型修复 + 依赖版本对齐
- ErrorCapture.ts: global → globalThis,移除 declare global 冲突 - index.ts: 移除不存在的 UpdateDownloadProgress 导出 - 各 package.json 版本号对齐 Co-Authored-By: Claude <noreply@anthropic.com>
这个提交包含在:
父节点
b2058840bc
当前提交
4e80b0bf4e
13
package.json
13
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@xuqm/rn-sdk",
|
||||
"version": "0.3.0",
|
||||
"version": "0.4.0-SNAPSHOT",
|
||||
"description": "XuqmGroup React Native SDK — meta-package (IM, Push, Update, Common)",
|
||||
"license": "UNLICENSED",
|
||||
"main": "src/index.ts",
|
||||
@ -26,17 +26,16 @@
|
||||
"react-native": ">=0.76.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@xuqm/rn-common": ">=0.2.0",
|
||||
"@xuqm/rn-common": ">=0.4.0",
|
||||
"@xuqm/rn-im": ">=0.2.0",
|
||||
"@xuqm/rn-license": ">=0.2.0",
|
||||
"@xuqm/rn-license": ">=0.3.0",
|
||||
"@xuqm/rn-log": ">=0.1.0",
|
||||
"@xuqm/rn-push": ">=0.2.0",
|
||||
"@xuqm/rn-update": ">=0.2.0",
|
||||
"@xuqm/rn-xwebview": ">=0.2.0",
|
||||
"react-native-qrcode-svg": "^6.3.21"
|
||||
"@xuqm/rn-update": ">=0.4.0",
|
||||
"@xuqm/rn-xwebview": ">=0.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^19.0.0",
|
||||
"@types/react-native": "^0.73.0",
|
||||
"axios": "^1.18.0",
|
||||
"typescript": "^5.9.3",
|
||||
"zod": "3.23.8"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@xuqm/rn-common",
|
||||
"version": "0.4.0",
|
||||
"version": "0.4.0-SNAPSHOT",
|
||||
"description": "XuqmGroup RN SDK — core: init, network, token management",
|
||||
"license": "UNLICENSED",
|
||||
"main": "src/index.ts",
|
||||
@ -22,7 +22,6 @@
|
||||
"devDependencies": {
|
||||
"typescript": "^5.9.3",
|
||||
"@types/react": "^19.0.0",
|
||||
"@types/react-native": "^0.73.0",
|
||||
"@react-native-async-storage/async-storage": "^2.1.2",
|
||||
"axios": "^1.7.0",
|
||||
"react": "^19.0.0",
|
||||
|
||||
@ -82,7 +82,7 @@ export async function getDeviceInfo(): Promise<DeviceInfo> {
|
||||
model: String(C.Model ?? ''),
|
||||
osVersion: String(C.Release ?? Platform.Version),
|
||||
pushVendor: detectPushVendor(brand),
|
||||
manufacturer: String(C.Manufacturer ?? undefined),
|
||||
manufacturer: C.Manufacturer ?? undefined,
|
||||
vendorVersion: undefined,
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@xuqm/rn-im",
|
||||
"version": "0.2.2",
|
||||
"version": "0.2.2-SNAPSHOT",
|
||||
"description": "XuqmGroup RN SDK — IM module (single chat, group chat, 13 message types)",
|
||||
"license": "UNLICENSED",
|
||||
"main": "src/index.ts",
|
||||
@ -22,7 +22,6 @@
|
||||
"react-native": ">=0.76.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.9.3",
|
||||
"@types/react-native": "^0.73.0"
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@xuqm/rn-license",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.0-SNAPSHOT",
|
||||
"description": "XuqmGroup RN SDK — License module (device registration & verification)",
|
||||
"license": "UNLICENSED",
|
||||
"main": "src/index.ts",
|
||||
@ -22,7 +22,6 @@
|
||||
"react-native-quick-crypto": ">=0.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.9.3",
|
||||
"@types/react-native": "^0.73.0"
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@xuqm/rn-log",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.0-SNAPSHOT",
|
||||
"description": "XuqmGroup RN SDK — log collection, error tracking, funnel analysis",
|
||||
"license": "UNLICENSED",
|
||||
"main": "src/index.ts",
|
||||
|
||||
@ -130,4 +130,12 @@ export const XLog = {
|
||||
async flush(): Promise<void> {
|
||||
if (_queue) await _queue.flush()
|
||||
},
|
||||
|
||||
/** Clean up resources (timers, etc.). Call on app termination if needed. */
|
||||
destroy(): void {
|
||||
if (_queue) {
|
||||
_queue.destroy()
|
||||
_queue = null
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@ -9,14 +9,8 @@ declare const ErrorUtils: {
|
||||
setGlobalHandler(handler: (error: Error, isFatal?: boolean) => void): void
|
||||
}
|
||||
|
||||
// React Native / Hermes exposes onunhandledrejection on global
|
||||
declare global {
|
||||
// eslint-disable-next-line no-var
|
||||
var onunhandledrejection:
|
||||
| ((event: { reason: unknown }) => void)
|
||||
| null
|
||||
| undefined
|
||||
}
|
||||
// React Native / Hermes exposes onunhandledrejection on globalThis
|
||||
type UnhandledRejectionHandler = ((event: { reason: unknown }) => void) | null | undefined
|
||||
|
||||
export const ErrorCapture = {
|
||||
start(onError: (error: unknown, meta?: Record<string, unknown>) => void): void {
|
||||
@ -31,8 +25,9 @@ export const ErrorCapture = {
|
||||
}
|
||||
|
||||
// Unhandled Promise rejection
|
||||
const prevUnhandled = global.onunhandledrejection
|
||||
global.onunhandledrejection = (event: { reason: unknown }) => {
|
||||
const g = globalThis as unknown as Record<string, unknown>
|
||||
const prevUnhandled = (g['onunhandledrejection'] as UnhandledRejectionHandler) ?? null
|
||||
g['onunhandledrejection'] = (event: { reason: unknown }) => {
|
||||
onError(event.reason, { type: 'unhandledRejection' })
|
||||
prevUnhandled?.(event)
|
||||
}
|
||||
|
||||
@ -4,12 +4,12 @@
|
||||
* Final aggregation is done server-side using the events uploaded by LogQueue.
|
||||
*/
|
||||
|
||||
interface FunnelDefinition {
|
||||
export interface FunnelDefinition {
|
||||
id: string
|
||||
steps: string[] // event names in order
|
||||
}
|
||||
|
||||
interface FunnelProgress {
|
||||
export interface FunnelProgress {
|
||||
funnelId: string
|
||||
completedSteps: string[]
|
||||
completedAt?: number
|
||||
|
||||
@ -1,3 +1,2 @@
|
||||
export { XLog } from './XLog'
|
||||
export type { LogLevel, Environment, LogEvent, IssueEvent, XLogEvent } from './types'
|
||||
export type { UpdateDownloadProgress } from './types'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@xuqm/rn-push",
|
||||
"version": "0.2.2",
|
||||
"version": "0.2.2-SNAPSHOT",
|
||||
"description": "XuqmGroup RN SDK — Push module (device token registration)",
|
||||
"license": "UNLICENSED",
|
||||
"main": "src/index.ts",
|
||||
@ -18,7 +18,6 @@
|
||||
"react-native": ">=0.76.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.9.3",
|
||||
"@types/react-native": "^0.73.0"
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@xuqm/rn-update",
|
||||
"version": "0.4.0",
|
||||
"version": "0.4.0-SNAPSHOT",
|
||||
"description": "XuqmGroup RN SDK — Update module (App update, RN plugin hot-update)",
|
||||
"license": "UNLICENSED",
|
||||
"main": "src/index.ts",
|
||||
@ -21,7 +21,6 @@
|
||||
"@react-native-async-storage/async-storage": ">=1.21.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.9.3",
|
||||
"@types/react-native": "^0.73.0"
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@xuqm/rn-xwebview",
|
||||
"version": "0.2.2",
|
||||
"version": "0.2.2-SNAPSHOT",
|
||||
"description": "XuqmGroup RN SDK — XWebView module",
|
||||
"license": "UNLICENSED",
|
||||
"main": "src/index.ts",
|
||||
@ -22,12 +22,11 @@
|
||||
"peerDependencies": {
|
||||
"react": ">=18.0.0",
|
||||
"react-native": ">=0.76.0",
|
||||
"@react-navigation/native": ">=7.0.0"
|
||||
"@react-navigation/native": ">=7.0.0",
|
||||
"react-native-safe-area-context": ">=4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^19.0.0",
|
||||
"@types/react-native": "^0.73.0",
|
||||
"react-native-safe-area-context": "^5.4.0",
|
||||
"@react-navigation/native": "^7.0.0",
|
||||
"@react-native-async-storage/async-storage": "^1.21.0",
|
||||
"typescript": "^5.9.3"
|
||||
|
||||
@ -11,8 +11,11 @@
|
||||
"@nozbe/watermelondb/adapters/sqlite": ["src/shims/watermelondb.ts"],
|
||||
"@xuqm/rn-common": ["packages/common/src"],
|
||||
"@xuqm/rn-im": ["packages/im/src"],
|
||||
"@xuqm/rn-license": ["packages/license/src"],
|
||||
"@xuqm/rn-log": ["packages/log/src"],
|
||||
"@xuqm/rn-push": ["packages/push/src"],
|
||||
"@xuqm/rn-update": ["packages/update/src"]
|
||||
"@xuqm/rn-update": ["packages/update/src"],
|
||||
"@xuqm/rn-xwebview": ["packages/xwebview/src"]
|
||||
},
|
||||
"strict": true,
|
||||
"experimentalDecorators": true,
|
||||
|
||||
正在加载...
在新工单中引用
屏蔽一个用户