miaoda-expo-devkit 0.1.1-beta.47 → 0.1.1-beta.48
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
CHANGED
|
@@ -10,6 +10,7 @@ Expo / React Native 开发环境工具集,通过 Metro 构建层注入以下
|
|
|
10
10
|
- **expo-notifications stub** — Expo Go(Android)中提供 no-op 实现,核心 API 调用时弹出带参数校验的调试 Alert,Dev Build 透传真实模块
|
|
11
11
|
- **expo-media-library stub** — Expo Go / Web 中提供 no-op 实现,`saveToLibraryAsync`、`createAssetAsync`、权限请求等 API 调用时弹出 Alert 提示,Dev Build 原生环境透传真实模块
|
|
12
12
|
- **expo-calendar stub** — Expo Go / Web 中提供 no-op 实现,`getEventsAsync`、`createEventAsync`、`getCalendarsAsync`、权限请求等核心 API 调用时弹出 Alert 提示并校验参数,Dev Build 原生环境透传真实模块
|
|
13
|
+
- **async-storage local repo 注入** — Expo Config Plugin,修复 `@react-native-async-storage/async-storage` v3.x 构建时找不到 `storage-android` AAR 的问题(上游 PR #1279 合并前的临时方案)
|
|
13
14
|
|
|
14
15
|
## 安装
|
|
15
16
|
|
|
@@ -30,6 +31,26 @@ pnpm install
|
|
|
30
31
|
|
|
31
32
|
## 使用
|
|
32
33
|
|
|
34
|
+
### Expo Config Plugin(async-storage v3)
|
|
35
|
+
|
|
36
|
+
`@react-native-async-storage/async-storage` v3.x 将 `storage-android` AAR 打包在本地 `local_repo` 目录,未发布至 Maven Central,需在 `android/build.gradle` 中手动注册路径。此 Plugin 在 `expo prebuild` 时自动完成注入。
|
|
37
|
+
|
|
38
|
+
在 `app.json` 中注册:
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"expo": {
|
|
43
|
+
"plugins": [
|
|
44
|
+
"miaoda-expo-devkit/plugin-async-storage-local-repo"
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
> 上游 PR [#1279](https://github.com/react-native-async-storage/async-storage/pull/1279) 合并并发版后可移除此 Plugin。
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
33
54
|
### Metro 配置
|
|
34
55
|
|
|
35
56
|
```js
|
|
@@ -288,6 +309,7 @@ sentry-react-native-stub.js
|
|
|
288
309
|
| `./expo-notifications-stub` | `dist/stubs/expo-notifications-stub.js` | `expo-notifications` Expo Go Android stub |
|
|
289
310
|
| `./expo-media-library-stub` | `dist/stubs/expo-media-library-stub.js` | `expo-media-library` Expo Go / Web stub |
|
|
290
311
|
| `./expo-calendar-stub` | `dist/stubs/expo-calendar-stub.js` | `expo-calendar` Expo Go / Web stub |
|
|
312
|
+
| `./plugin-async-storage-local-repo` | `dist/plugins/with-async-storage-local-repo.js` | Expo Config Plugin:注入 async-storage v3 本地 Maven 仓库路径 |
|
|
291
313
|
|
|
292
314
|
---
|
|
293
315
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/plugins/with-async-storage-local-repo.ts
|
|
21
|
+
var with_async_storage_local_repo_exports = {};
|
|
22
|
+
__export(with_async_storage_local_repo_exports, {
|
|
23
|
+
default: () => with_async_storage_local_repo_default
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(with_async_storage_local_repo_exports);
|
|
26
|
+
var import_config_plugins = require("@expo/config-plugins");
|
|
27
|
+
var MAVEN_BLOCK = ` maven {
|
|
28
|
+
// @react-native-async-storage/async-storage v3 \u5C06 storage-android AAR
|
|
29
|
+
// \u6253\u5305\u5728\u672C\u5730 local_repo \u4E2D\uFF0C\u672A\u53D1\u5E03\u81F3 Maven Central\uFF0C\u9700\u624B\u52A8\u6CE8\u518C\u8DEF\u5F84\u3002
|
|
30
|
+
// \u5F85\u4E0A\u6E38 PR #1279 \u5408\u5E76\u53D1\u7248\u540E\u53EF\u79FB\u9664\u6B64\u63D2\u4EF6\u3002
|
|
31
|
+
url = uri("../node_modules/@react-native-async-storage/async-storage/android/local_repo")
|
|
32
|
+
}`;
|
|
33
|
+
var withAsyncStorageLocalRepo = (config) => {
|
|
34
|
+
return (0, import_config_plugins.withProjectBuildGradle)(config, (config2) => {
|
|
35
|
+
if (config2.modResults.contents.includes("async-storage/android/local_repo")) {
|
|
36
|
+
return config2;
|
|
37
|
+
}
|
|
38
|
+
config2.modResults.contents = config2.modResults.contents.replace(
|
|
39
|
+
/allprojects\s*\{[^}]*repositories\s*\{/,
|
|
40
|
+
(match) => `${match}
|
|
41
|
+
${MAVEN_BLOCK}`
|
|
42
|
+
);
|
|
43
|
+
return config2;
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
var with_async_storage_local_repo_default = withAsyncStorageLocalRepo;
|
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.48",
|
|
4
4
|
"description": "Expo 应用开发工具集:Sentry DSN 替换 stub、错误/网络捕获、Metro 符号化",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"./rules/no-pressable-without-on-press": "./dist/rules/no-pressable-without-on-press.js",
|
|
60
60
|
"./rules/no-expo-video-compat": "./dist/rules/no-expo-video-compat.js",
|
|
61
61
|
"./rules/no-inline-box-shadow-string": "./dist/rules/no-inline-box-shadow-string.js",
|
|
62
|
+
"./plugin-async-storage-local-repo": "./dist/plugins/with-async-storage-local-repo.js",
|
|
62
63
|
"./biome": "./biome-config.json",
|
|
63
64
|
"./oxlint": "./oxlint-config.json",
|
|
64
65
|
"./tsconfig-base": "./tsconfig-base.json"
|
|
@@ -80,6 +81,7 @@
|
|
|
80
81
|
"stacktrace-parser": "^0.1.11"
|
|
81
82
|
},
|
|
82
83
|
"peerDependencies": {
|
|
84
|
+
"@expo/config-plugins": ">=8.0.0",
|
|
83
85
|
"@sentry/core": "^10.38.0",
|
|
84
86
|
"@sentry/react-native": ">=8.0.0",
|
|
85
87
|
"metro": ">=0.80.0",
|
|
@@ -92,6 +94,9 @@
|
|
|
92
94
|
"typescript": ">=5.0.0"
|
|
93
95
|
},
|
|
94
96
|
"peerDependenciesMeta": {
|
|
97
|
+
"@expo/config-plugins": {
|
|
98
|
+
"optional": true
|
|
99
|
+
},
|
|
95
100
|
"@sentry/core": {
|
|
96
101
|
"optional": true
|
|
97
102
|
},
|