miaoda-expo-devkit 0.1.1-beta.125 → 0.1.1-beta.126
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 +0 -1
- package/docs/patches.md +5 -0
- package/package.json +2 -49
- package/pnpm-patches/react-native@0.83.2.patch +4 -66
- package/pnpmfile.cjs +16 -1
package/README.md
CHANGED
|
@@ -79,7 +79,6 @@ Sentry.init({
|
|
|
79
79
|
- `console.warn`、`console.error` 不再弹出 LogBox 底部通知;
|
|
80
80
|
- 原始日志仍会输出到 Metro、ADB 或 Xcode 控制台;
|
|
81
81
|
- 未捕获的 JavaScript 异常继续展示错误详情;未处理的 Promise 拒绝由 RN 与 Expo runtime 托管补丁单独自动打开详情,不受普通通知隐藏影响;
|
|
82
|
-
- 错误详情点「最小化」后,该条日志保留底部横幅作为重新打开入口(RN 托管补丁单独放行),点「关闭」或清除后横幅消失;其他日志的通知仍隐藏;
|
|
83
82
|
- 如需临时恢复 LogBox,可在应用调试代码中调用 `LogBox.ignoreAllLogs(false)`。
|
|
84
83
|
|
|
85
84
|
该策略属于 JavaScript Bundle 的公共启动注入,不修改业务页面,也不需要在每个应用中重复配置。未使用
|
package/docs/patches.md
CHANGED
|
@@ -66,6 +66,11 @@ lockfile。
|
|
|
66
66
|
DevKit 内置文件;内容不同的项目定制 patch 会继续优先,并输出警告。项目中其他
|
|
67
67
|
`patchedDependencies` 不受影响。迁移后必须重新生成并提交 `pnpm-lock.yaml`。
|
|
68
68
|
|
|
69
|
+
pnpm 10 在安装阶段会用根 `package.json#pnpm.patchedDependencies` 整体覆盖 hook 合并后的
|
|
70
|
+
结果。因此当该字段存在时,hook 会把合并后的最终集合就地写回内存中的
|
|
71
|
+
`rootProjectManifest.pnpm.patchedDependencies`(hook 本身不写磁盘);该字段不存在时不会创建。
|
|
72
|
+
pnpm 11 不再读取 `package.json#pnpm`,无需此处理。
|
|
73
|
+
|
|
69
74
|
## 发布前验证
|
|
70
75
|
|
|
71
76
|
发布前可用一条命令运行轻量集成测试:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "miaoda-expo-devkit",
|
|
3
|
-
"version": "0.1.1-beta.
|
|
3
|
+
"version": "0.1.1-beta.126",
|
|
4
4
|
"description": "Expo 应用开发工具集:Sentry DSN 替换 stub、错误/网络捕获、Metro 符号化",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -172,52 +172,5 @@
|
|
|
172
172
|
"publishConfig": {
|
|
173
173
|
"registry": "https://registry.npmjs.org/",
|
|
174
174
|
"access": "public"
|
|
175
|
-
},
|
|
176
|
-
"clean-publish": {
|
|
177
|
-
"fields": [
|
|
178
|
-
"devDependencies",
|
|
179
|
-
"scripts"
|
|
180
|
-
]
|
|
181
|
-
},
|
|
182
|
-
"devDependencies": {
|
|
183
|
-
"@babel/core": "^7.26.0",
|
|
184
|
-
"@babel/helper-module-imports": "^7.28.6",
|
|
185
|
-
"@biomejs/biome": "^2.4.12",
|
|
186
|
-
"@sentry/core": "10.49.0",
|
|
187
|
-
"@sentry/react-native": "8.9.2",
|
|
188
|
-
"@types/babel__core": "^7.20.5",
|
|
189
|
-
"@types/babel__helper-module-imports": "^7.18.3",
|
|
190
|
-
"@types/connect": "^3.4.38",
|
|
191
|
-
"@types/lodash.throttle": "^4.1.9",
|
|
192
|
-
"@types/node": "^25.0.0",
|
|
193
|
-
"@types/semver": "^7.7.1",
|
|
194
|
-
"@expo/schemer": "^2.1.4",
|
|
195
|
-
"clean-publish": "^6.0.5",
|
|
196
|
-
"expo-router": "55.0.5",
|
|
197
|
-
"lucide-react-native": "^1.11.0",
|
|
198
|
-
"lucide-react-native-v1-8": "npm:lucide-react-native@~1.8.0",
|
|
199
|
-
"metro": "^0.83.0",
|
|
200
|
-
"metro-cache": "^0.83.0",
|
|
201
|
-
"metro-config": "^0.83.0",
|
|
202
|
-
"metro-core": "^0.83.0",
|
|
203
|
-
"metro-resolver": "^0.83.0",
|
|
204
|
-
"oxlint": "^1.60.0",
|
|
205
|
-
"react-native": "0.83.2",
|
|
206
|
-
"semver": "^7.7.4",
|
|
207
|
-
"tsup": "^8.5.1",
|
|
208
|
-
"typescript": "~5.9.2",
|
|
209
|
-
"vitest": "^4.1.5"
|
|
210
|
-
},
|
|
211
|
-
"scripts": {
|
|
212
|
-
"build": "tsup",
|
|
213
|
-
"typecheck": "tsc --noEmit && tsc -p tsconfig.check.json --noEmit",
|
|
214
|
-
"test": "vitest run",
|
|
215
|
-
"test:patches": "node scripts/test-patches.mjs",
|
|
216
|
-
"patch:workspace": "node scripts/patch-workspace.mjs",
|
|
217
|
-
"release": "pnpm run test && pnpm run build && clean-publish",
|
|
218
|
-
"release:beta": "pnpm run test && pnpm run build && npm version prerelease --preid=beta && clean-publish --tag beta",
|
|
219
|
-
"release:patch": "pnpm run test && pnpm run build && npm version patch && clean-publish",
|
|
220
|
-
"release:minor": "pnpm run test && pnpm run build && npm version minor && clean-publish",
|
|
221
|
-
"release:major": "pnpm run test && pnpm run build && npm version major && clean-publish"
|
|
222
175
|
}
|
|
223
|
-
}
|
|
176
|
+
}
|
|
@@ -144,20 +144,16 @@ index 0000000..9b01194
|
|
|
144
144
|
+ };
|
|
145
145
|
+}
|
|
146
146
|
diff --git a/Libraries/LogBox/Data/LogBoxData.js b/Libraries/LogBox/Data/LogBoxData.js
|
|
147
|
-
index 2ce92e0..
|
|
147
|
+
index 2ce92e0..da840bd 100644
|
|
148
148
|
--- a/Libraries/LogBox/Data/LogBoxData.js
|
|
149
149
|
+++ b/Libraries/LogBox/Data/LogBoxData.js
|
|
150
|
-
@@ -139,24 +139,
|
|
150
|
+
@@ -139,24 +139,50 @@ function handleUpdate(): void {
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
-function appendNewLog(newLog: LogBoxLog) {
|
|
155
155
|
+// Promise 拒绝仍保留 error 级别,仅改变展示策略;弱引用不延长日志生命周期。
|
|
156
156
|
+const promiseRejectionLogs: WeakSet<LogBoxLog> = new WeakSet();
|
|
157
|
-
+// 用户主动最小化的日志。DevKit 默认 ignoreAllLogs(true) 隐藏普通通知,
|
|
158
|
-
+// 最小化的日志仍需保留底部横幅作为重新打开详情的入口,否则与关闭无异。
|
|
159
|
-
+// 关闭或清空后日志离开 logs,横幅随之消失,无需额外清理。
|
|
160
|
-
+const minimizedLogs: WeakSet<LogBoxLog> = new WeakSet();
|
|
161
157
|
+
|
|
162
158
|
+function appendNewLog(newLog: LogBoxLog, isPromiseRejection: boolean = false) {
|
|
163
159
|
// Don't want store these logs because they trigger a
|
|
@@ -209,7 +205,7 @@ index 2ce92e0..671733a 100644
|
|
|
209
205
|
// If possible, to avoid jank, we don't want to open the error before
|
|
210
206
|
// it's symbolicated. To do that, we optimistically wait for
|
|
211
207
|
// symbolication for up to a second before adding the log.
|
|
212
|
-
@@ -164,7 +
|
|
208
|
+
@@ -164,7 +190,7 @@ function appendNewLog(newLog: LogBoxLog) {
|
|
213
209
|
|
|
214
210
|
let addPendingLog: ?() => void = () => {
|
|
215
211
|
logs.add(newLog);
|
|
@@ -218,7 +214,7 @@ index 2ce92e0..671733a 100644
|
|
|
218
214
|
setSelectedLog(logs.size - 1);
|
|
219
215
|
} else {
|
|
220
216
|
handleUpdate();
|
|
221
|
-
@@ -251,7 +
|
|
217
|
+
@@ -251,7 +277,10 @@ export function addException(error: ExtendedExceptionData): void {
|
|
222
218
|
// otherwise spammy logs would pause rendering.
|
|
223
219
|
setImmediate(() => {
|
|
224
220
|
try {
|
|
@@ -230,26 +226,6 @@ index 2ce92e0..671733a 100644
|
|
|
230
226
|
} catch (loggingError) {
|
|
231
227
|
reportLogBoxError(loggingError);
|
|
232
228
|
}
|
|
233
|
-
@@ -308,6 +341,19 @@ export function setSelectedLog(proposedNewIndex: number): void {
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
+// 收起当前详情并保留其通知入口;语法错误仍由 setSelectedLog 强制展示。
|
|
238
|
-
+export function minimizeSelectedLog(): void {
|
|
239
|
-
+ const selected = Array.from(logs)[_selectedIndex];
|
|
240
|
-
+ if (selected != null) {
|
|
241
|
-
+ minimizedLogs.add(selected);
|
|
242
|
-
+ }
|
|
243
|
-
+ setSelectedLog(-1);
|
|
244
|
-
+}
|
|
245
|
-
+
|
|
246
|
-
+export function isMinimized(log: LogBoxLog): boolean {
|
|
247
|
-
+ return minimizedLogs.has(log);
|
|
248
|
-
+}
|
|
249
|
-
+
|
|
250
|
-
export function clearWarnings(): void {
|
|
251
|
-
const newLogs = Array.from(logs).filter(log => log.level !== 'warn');
|
|
252
|
-
if (newLogs.length !== logs.size) {
|
|
253
229
|
diff --git a/Libraries/LogBox/Data/LogBoxPromptCopy.js b/Libraries/LogBox/Data/LogBoxPromptCopy.js
|
|
254
230
|
new file mode 100644
|
|
255
231
|
index 0000000..19105cb
|
|
@@ -284,44 +260,6 @@ index 0000000..19105cb
|
|
|
284
260
|
+ copyConfirmQuestion: '仍要复制错误给智能体修复吗?',
|
|
285
261
|
+ copyConfirmButtonTitle: '仍要复制错误',
|
|
286
262
|
+};
|
|
287
|
-
diff --git a/Libraries/LogBox/LogBoxInspectorContainer.js b/Libraries/LogBox/LogBoxInspectorContainer.js
|
|
288
|
-
index 3ccf93a..26ca59f 100644
|
|
289
|
-
--- a/Libraries/LogBox/LogBoxInspectorContainer.js
|
|
290
|
-
+++ b/Libraries/LogBox/LogBoxInspectorContainer.js
|
|
291
|
-
@@ -55,7 +55,7 @@ export class _LogBoxInspectorContainer extends React.Component<Props> {
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
_handleMinimize = (): void => {
|
|
295
|
-
- LogBoxData.setSelectedLog(-1);
|
|
296
|
-
+ LogBoxData.minimizeSelectedLog();
|
|
297
|
-
};
|
|
298
|
-
|
|
299
|
-
_handleSetSelectedLog = (index: number): void => {
|
|
300
|
-
diff --git a/Libraries/LogBox/LogBoxNotificationContainer.js b/Libraries/LogBox/LogBoxNotificationContainer.js
|
|
301
|
-
index a3fa687..309f2d5 100644
|
|
302
|
-
--- a/Libraries/LogBox/LogBoxNotificationContainer.js
|
|
303
|
-
+++ b/Libraries/LogBox/LogBoxNotificationContainer.js
|
|
304
|
-
@@ -50,12 +50,17 @@ export function _LogBoxNotificationContainer(props: Props): React.Node {
|
|
305
|
-
setSelectedLog(index);
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
- if (logs.length === 0 || props.isDisabled === true) {
|
|
309
|
-
+ // 通知被全局隐藏时只保留用户最小化的日志,作为重新打开详情的入口。
|
|
310
|
-
+ const visibleLogs =
|
|
311
|
-
+ props.isDisabled === true
|
|
312
|
-
+ ? logs.filter(log => LogBoxData.isMinimized(log))
|
|
313
|
-
+ : logs;
|
|
314
|
-
+ if (visibleLogs.length === 0) {
|
|
315
|
-
return null;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
- const warnings = logs.filter(log => log.level === 'warn');
|
|
319
|
-
- const errors = logs.filter(
|
|
320
|
-
+ const warnings = visibleLogs.filter(log => log.level === 'warn');
|
|
321
|
-
+ const errors = visibleLogs.filter(
|
|
322
|
-
log => log.level === 'error' || log.level === 'fatal',
|
|
323
|
-
);
|
|
324
|
-
return (
|
|
325
263
|
diff --git a/Libraries/LogBox/UI/LogBoxInspector.js b/Libraries/LogBox/UI/LogBoxInspector.js
|
|
326
264
|
index be889b0..854c1cf 100644
|
|
327
265
|
--- a/Libraries/LogBox/UI/LogBoxInspector.js
|
package/pnpmfile.cjs
CHANGED
|
@@ -11,7 +11,6 @@ const managedPatches = {
|
|
|
11
11
|
[REACT_NATIVE_PATCH_SELECTOR]: {
|
|
12
12
|
filename: 'react-native@0.83.2.patch',
|
|
13
13
|
legacyHashes: new Set([
|
|
14
|
-
'7c80a1caedd1c4397c7d3a8cf253b76a5d93c25779150c5cbadcac1a270f0312',
|
|
15
14
|
'5506d130966fbe0539c3a7de1b4b0dac4f39fe21efde52307bb3c4b99837c01c',
|
|
16
15
|
'd7f25406e993a4d0f2a0f0ee508769ffc630e293456348492f5a1ffa000271d0',
|
|
17
16
|
'a5cb4e26aa64ec29e7a81bbec0f9ea36bcac15e2eea53b15491cd01095885296',
|
|
@@ -195,6 +194,20 @@ function projectRequestsLegacySelector(config, selector) {
|
|
|
195
194
|
}
|
|
196
195
|
}
|
|
197
196
|
|
|
197
|
+
// updateConfig 合并出的 patchedDependencies 在 pnpm 10 下不会生效:安装阶段 pnpm 会用
|
|
198
|
+
// getOptionsFromRootManifest 重读 rootProjectManifest.pnpm,字段存在时其值整体覆盖 install 的 opts
|
|
199
|
+
// (即 hook 处理后的 config 展开出的安装选项),合并结果被丢弃。
|
|
200
|
+
// 所以必须把最终集合同步回该内存对象(hook 不写磁盘)。pnpm 11 不再读取 package.json#pnpm,迁移后可删除。
|
|
201
|
+
function syncRootManifestPatches(config, patchedDependencies) {
|
|
202
|
+
const pnpmSettings = config.rootProjectManifest?.pnpm;
|
|
203
|
+
const manifestPatches = pnpmSettings?.patchedDependencies;
|
|
204
|
+
const isPlainObject =
|
|
205
|
+
manifestPatches != null && typeof manifestPatches === 'object' && !Array.isArray(manifestPatches);
|
|
206
|
+
if (!isPlainObject) return;
|
|
207
|
+
|
|
208
|
+
pnpmSettings.patchedDependencies = { ...patchedDependencies };
|
|
209
|
+
}
|
|
210
|
+
|
|
198
211
|
function applyManagedPatches(config) {
|
|
199
212
|
const patchedDependencies = { ...config.patchedDependencies };
|
|
200
213
|
|
|
@@ -236,6 +249,8 @@ function applyManagedPatches(config) {
|
|
|
236
249
|
);
|
|
237
250
|
}
|
|
238
251
|
|
|
252
|
+
syncRootManifestPatches(config, patchedDependencies);
|
|
253
|
+
|
|
239
254
|
const configuredMaxLength = Number.isFinite(config.virtualStoreDirMaxLength)
|
|
240
255
|
? config.virtualStoreDirMaxLength
|
|
241
256
|
: 120;
|