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",
|
"name": "@xuqm/rn-sdk",
|
||||||
"version": "0.3.0",
|
"version": "0.4.0-SNAPSHOT",
|
||||||
"description": "XuqmGroup React Native SDK — meta-package (IM, Push, Update, Common)",
|
"description": "XuqmGroup React Native SDK — meta-package (IM, Push, Update, Common)",
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
@ -26,17 +26,16 @@
|
|||||||
"react-native": ">=0.76.0"
|
"react-native": ">=0.76.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@xuqm/rn-common": ">=0.2.0",
|
"@xuqm/rn-common": ">=0.4.0",
|
||||||
"@xuqm/rn-im": ">=0.2.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-push": ">=0.2.0",
|
||||||
"@xuqm/rn-update": ">=0.2.0",
|
"@xuqm/rn-update": ">=0.4.0",
|
||||||
"@xuqm/rn-xwebview": ">=0.2.0",
|
"@xuqm/rn-xwebview": ">=0.2.0"
|
||||||
"react-native-qrcode-svg": "^6.3.21"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/react": "^19.0.0",
|
"@types/react": "^19.0.0",
|
||||||
"@types/react-native": "^0.73.0",
|
|
||||||
"axios": "^1.18.0",
|
"axios": "^1.18.0",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"zod": "3.23.8"
|
"zod": "3.23.8"
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@xuqm/rn-common",
|
"name": "@xuqm/rn-common",
|
||||||
"version": "0.4.0",
|
"version": "0.4.0-SNAPSHOT",
|
||||||
"description": "XuqmGroup RN SDK — core: init, network, token management",
|
"description": "XuqmGroup RN SDK — core: init, network, token management",
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
@ -22,7 +22,6 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"@types/react": "^19.0.0",
|
"@types/react": "^19.0.0",
|
||||||
"@types/react-native": "^0.73.0",
|
|
||||||
"@react-native-async-storage/async-storage": "^2.1.2",
|
"@react-native-async-storage/async-storage": "^2.1.2",
|
||||||
"axios": "^1.7.0",
|
"axios": "^1.7.0",
|
||||||
"react": "^19.0.0",
|
"react": "^19.0.0",
|
||||||
|
|||||||
@ -82,7 +82,7 @@ export async function getDeviceInfo(): Promise<DeviceInfo> {
|
|||||||
model: String(C.Model ?? ''),
|
model: String(C.Model ?? ''),
|
||||||
osVersion: String(C.Release ?? Platform.Version),
|
osVersion: String(C.Release ?? Platform.Version),
|
||||||
pushVendor: detectPushVendor(brand),
|
pushVendor: detectPushVendor(brand),
|
||||||
manufacturer: String(C.Manufacturer ?? undefined),
|
manufacturer: C.Manufacturer ?? undefined,
|
||||||
vendorVersion: undefined,
|
vendorVersion: undefined,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@xuqm/rn-im",
|
"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)",
|
"description": "XuqmGroup RN SDK — IM module (single chat, group chat, 13 message types)",
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
@ -22,7 +22,6 @@
|
|||||||
"react-native": ">=0.76.0"
|
"react-native": ">=0.76.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3"
|
||||||
"@types/react-native": "^0.73.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@xuqm/rn-license",
|
"name": "@xuqm/rn-license",
|
||||||
"version": "0.3.0",
|
"version": "0.3.0-SNAPSHOT",
|
||||||
"description": "XuqmGroup RN SDK — License module (device registration & verification)",
|
"description": "XuqmGroup RN SDK — License module (device registration & verification)",
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
@ -22,7 +22,6 @@
|
|||||||
"react-native-quick-crypto": ">=0.7.0"
|
"react-native-quick-crypto": ">=0.7.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3"
|
||||||
"@types/react-native": "^0.73.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@xuqm/rn-log",
|
"name": "@xuqm/rn-log",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0-SNAPSHOT",
|
||||||
"description": "XuqmGroup RN SDK — log collection, error tracking, funnel analysis",
|
"description": "XuqmGroup RN SDK — log collection, error tracking, funnel analysis",
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
|
|||||||
@ -130,4 +130,12 @@ export const XLog = {
|
|||||||
async flush(): Promise<void> {
|
async flush(): Promise<void> {
|
||||||
if (_queue) await _queue.flush()
|
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
|
setGlobalHandler(handler: (error: Error, isFatal?: boolean) => void): void
|
||||||
}
|
}
|
||||||
|
|
||||||
// React Native / Hermes exposes onunhandledrejection on global
|
// React Native / Hermes exposes onunhandledrejection on globalThis
|
||||||
declare global {
|
type UnhandledRejectionHandler = ((event: { reason: unknown }) => void) | null | undefined
|
||||||
// eslint-disable-next-line no-var
|
|
||||||
var onunhandledrejection:
|
|
||||||
| ((event: { reason: unknown }) => void)
|
|
||||||
| null
|
|
||||||
| undefined
|
|
||||||
}
|
|
||||||
|
|
||||||
export const ErrorCapture = {
|
export const ErrorCapture = {
|
||||||
start(onError: (error: unknown, meta?: Record<string, unknown>) => void): void {
|
start(onError: (error: unknown, meta?: Record<string, unknown>) => void): void {
|
||||||
@ -31,8 +25,9 @@ export const ErrorCapture = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Unhandled Promise rejection
|
// Unhandled Promise rejection
|
||||||
const prevUnhandled = global.onunhandledrejection
|
const g = globalThis as unknown as Record<string, unknown>
|
||||||
global.onunhandledrejection = (event: { reason: unknown }) => {
|
const prevUnhandled = (g['onunhandledrejection'] as UnhandledRejectionHandler) ?? null
|
||||||
|
g['onunhandledrejection'] = (event: { reason: unknown }) => {
|
||||||
onError(event.reason, { type: 'unhandledRejection' })
|
onError(event.reason, { type: 'unhandledRejection' })
|
||||||
prevUnhandled?.(event)
|
prevUnhandled?.(event)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,12 +4,12 @@
|
|||||||
* Final aggregation is done server-side using the events uploaded by LogQueue.
|
* Final aggregation is done server-side using the events uploaded by LogQueue.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
interface FunnelDefinition {
|
export interface FunnelDefinition {
|
||||||
id: string
|
id: string
|
||||||
steps: string[] // event names in order
|
steps: string[] // event names in order
|
||||||
}
|
}
|
||||||
|
|
||||||
interface FunnelProgress {
|
export interface FunnelProgress {
|
||||||
funnelId: string
|
funnelId: string
|
||||||
completedSteps: string[]
|
completedSteps: string[]
|
||||||
completedAt?: number
|
completedAt?: number
|
||||||
|
|||||||
@ -1,3 +1,2 @@
|
|||||||
export { XLog } from './XLog'
|
export { XLog } from './XLog'
|
||||||
export type { LogLevel, Environment, LogEvent, IssueEvent, XLogEvent } from './types'
|
export type { LogLevel, Environment, LogEvent, IssueEvent, XLogEvent } from './types'
|
||||||
export type { UpdateDownloadProgress } from './types'
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@xuqm/rn-push",
|
"name": "@xuqm/rn-push",
|
||||||
"version": "0.2.2",
|
"version": "0.2.2-SNAPSHOT",
|
||||||
"description": "XuqmGroup RN SDK — Push module (device token registration)",
|
"description": "XuqmGroup RN SDK — Push module (device token registration)",
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
@ -18,7 +18,6 @@
|
|||||||
"react-native": ">=0.76.0"
|
"react-native": ">=0.76.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3"
|
||||||
"@types/react-native": "^0.73.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@xuqm/rn-update",
|
"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)",
|
"description": "XuqmGroup RN SDK — Update module (App update, RN plugin hot-update)",
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
@ -21,7 +21,6 @@
|
|||||||
"@react-native-async-storage/async-storage": ">=1.21.0"
|
"@react-native-async-storage/async-storage": ">=1.21.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3"
|
||||||
"@types/react-native": "^0.73.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@xuqm/rn-xwebview",
|
"name": "@xuqm/rn-xwebview",
|
||||||
"version": "0.2.2",
|
"version": "0.2.2-SNAPSHOT",
|
||||||
"description": "XuqmGroup RN SDK — XWebView module",
|
"description": "XuqmGroup RN SDK — XWebView module",
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
@ -22,12 +22,11 @@
|
|||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": ">=18.0.0",
|
"react": ">=18.0.0",
|
||||||
"react-native": ">=0.76.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": {
|
"devDependencies": {
|
||||||
"@types/react": "^19.0.0",
|
"@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-navigation/native": "^7.0.0",
|
||||||
"@react-native-async-storage/async-storage": "^1.21.0",
|
"@react-native-async-storage/async-storage": "^1.21.0",
|
||||||
"typescript": "^5.9.3"
|
"typescript": "^5.9.3"
|
||||||
|
|||||||
@ -11,8 +11,11 @@
|
|||||||
"@nozbe/watermelondb/adapters/sqlite": ["src/shims/watermelondb.ts"],
|
"@nozbe/watermelondb/adapters/sqlite": ["src/shims/watermelondb.ts"],
|
||||||
"@xuqm/rn-common": ["packages/common/src"],
|
"@xuqm/rn-common": ["packages/common/src"],
|
||||||
"@xuqm/rn-im": ["packages/im/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-push": ["packages/push/src"],
|
||||||
"@xuqm/rn-update": ["packages/update/src"]
|
"@xuqm/rn-update": ["packages/update/src"],
|
||||||
|
"@xuqm/rn-xwebview": ["packages/xwebview/src"]
|
||||||
},
|
},
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
|
|||||||
正在加载...
在新工单中引用
屏蔽一个用户