miaoda-expo-devkit 0.1.1-beta.16 → 0.1.1-beta.17

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/dist/metro.d.mts CHANGED
@@ -169,6 +169,7 @@ declare function withDevkit(config: MetroConfig, options?: DevkitOptions): Metro
169
169
  * 注入行为:
170
170
  * 1. web 平台:@expo/log-box 及 ErrorOverlayWebControls → no-op-logbox stub(屏蔽全屏错误遮罩)
171
171
  * 2. 所有平台:@sentry/react-native → sentry-react-native-stub(替换 DSN,注入内置捕获器)
172
+ * 3. Android 平台:expo-notifications → expo-notifications-stub(Expo Go 时 no-op + Alert,Development Build 时透传)
172
173
  *
173
174
  * 自动保留并调用已有的 resolveRequest,支持与其他 Metro 配置链式组合。
174
175
  *
package/dist/metro.d.ts CHANGED
@@ -169,6 +169,7 @@ declare function withDevkit(config: MetroConfig, options?: DevkitOptions): Metro
169
169
  * 注入行为:
170
170
  * 1. web 平台:@expo/log-box 及 ErrorOverlayWebControls → no-op-logbox stub(屏蔽全屏错误遮罩)
171
171
  * 2. 所有平台:@sentry/react-native → sentry-react-native-stub(替换 DSN,注入内置捕获器)
172
+ * 3. Android 平台:expo-notifications → expo-notifications-stub(Expo Go 时 no-op + Alert,Development Build 时透传)
172
173
  *
173
174
  * 自动保留并调用已有的 resolveRequest,支持与其他 Metro 配置链式组合。
174
175
  *
package/dist/metro.js CHANGED
@@ -80,8 +80,14 @@ function withNativeWind(config, options) {
80
80
  // src/metro/withDevStubs.ts
81
81
  var import_path2 = __toESM(require("path"));
82
82
  var SENTRY_STUB_FILENAME = "sentry-react-native-stub.js";
83
+ var EXPO_NOTIFICATIONS_STUB_FILENAME = "expo-notifications-stub.js";
83
84
  var SENTRY_STUB_PATH = import_path2.default.resolve(__dirname, "stubs", SENTRY_STUB_FILENAME);
84
85
  var NO_OP_LOGBOX_STUB_PATH = import_path2.default.resolve(__dirname, "stubs", "no-op-logbox.js");
86
+ var EXPO_NOTIFICATIONS_STUB_PATH = import_path2.default.resolve(
87
+ __dirname,
88
+ "stubs",
89
+ EXPO_NOTIFICATIONS_STUB_FILENAME
90
+ );
85
91
  function withDevStubs(config) {
86
92
  const upstream = config.resolver?.resolveRequest ?? null;
87
93
  const resolveRequest = (context, moduleName, platform) => {
@@ -93,6 +99,9 @@ function withDevStubs(config) {
93
99
  if (moduleName === "@sentry/react-native" && !context.originModulePath.includes(SENTRY_STUB_FILENAME)) {
94
100
  return { filePath: SENTRY_STUB_PATH, type: "sourceFile" };
95
101
  }
102
+ if (platform === "android" && moduleName === "expo-notifications" && !context.originModulePath.includes(EXPO_NOTIFICATIONS_STUB_FILENAME)) {
103
+ return { filePath: EXPO_NOTIFICATIONS_STUB_PATH, type: "sourceFile" };
104
+ }
96
105
  if (upstream) {
97
106
  return upstream(context, moduleName, platform);
98
107
  }
package/dist/metro.mjs CHANGED
@@ -43,8 +43,14 @@ function withNativeWind(config, options) {
43
43
  // src/metro/withDevStubs.ts
44
44
  import path2 from "path";
45
45
  var SENTRY_STUB_FILENAME = "sentry-react-native-stub.js";
46
+ var EXPO_NOTIFICATIONS_STUB_FILENAME = "expo-notifications-stub.js";
46
47
  var SENTRY_STUB_PATH = path2.resolve(__dirname, "stubs", SENTRY_STUB_FILENAME);
47
48
  var NO_OP_LOGBOX_STUB_PATH = path2.resolve(__dirname, "stubs", "no-op-logbox.js");
49
+ var EXPO_NOTIFICATIONS_STUB_PATH = path2.resolve(
50
+ __dirname,
51
+ "stubs",
52
+ EXPO_NOTIFICATIONS_STUB_FILENAME
53
+ );
48
54
  function withDevStubs(config) {
49
55
  const upstream = config.resolver?.resolveRequest ?? null;
50
56
  const resolveRequest = (context, moduleName, platform) => {
@@ -56,6 +62,9 @@ function withDevStubs(config) {
56
62
  if (moduleName === "@sentry/react-native" && !context.originModulePath.includes(SENTRY_STUB_FILENAME)) {
57
63
  return { filePath: SENTRY_STUB_PATH, type: "sourceFile" };
58
64
  }
65
+ if (platform === "android" && moduleName === "expo-notifications" && !context.originModulePath.includes(EXPO_NOTIFICATIONS_STUB_FILENAME)) {
66
+ return { filePath: EXPO_NOTIFICATIONS_STUB_PATH, type: "sourceFile" };
67
+ }
59
68
  if (upstream) {
60
69
  return upstream(context, moduleName, platform);
61
70
  }
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var import_expo = require("expo");
3
+ var import_react_native = require("react-native");
4
+ if (!(0, import_expo.isRunningInExpoGo)()) {
5
+ module.exports = require("expo-notifications");
6
+ } else {
7
+ let _alertShown = false;
8
+ const showAlert = () => {
9
+ if (_alertShown) return;
10
+ _alertShown = true;
11
+ import_react_native.Alert.alert(
12
+ "\u901A\u77E5\u529F\u80FD\u4E0D\u53EF\u7528",
13
+ "Expo Go\uFF08Android\uFF09\u4E0D\u652F\u6301\u672C\u5730\u901A\u77E5\u3002\n\n\u5982\u9700\u5B8C\u6574\u901A\u77E5\u529F\u80FD\uFF0C\u8BF7\u4F7F\u7528 Development Build \u8FD0\u884C\u672C\u5E94\u7528\u3002",
14
+ [{ text: "\u77E5\u9053\u4E86" }]
15
+ );
16
+ };
17
+ const noop = async () => {
18
+ showAlert();
19
+ };
20
+ const noopListener = () => {
21
+ showAlert();
22
+ return { remove: () => {
23
+ } };
24
+ };
25
+ const enums = {
26
+ AndroidNotificationPriority: {
27
+ MIN: "min",
28
+ LOW: "low",
29
+ DEFAULT: "default",
30
+ HIGH: "high",
31
+ MAX: "max"
32
+ },
33
+ AndroidImportance: { NONE: 0, MIN: 1, LOW: 2, DEFAULT: 3, HIGH: 4, MAX: 5 },
34
+ SchedulableTriggerInputTypes: {
35
+ DATE: "date",
36
+ TIME_INTERVAL: "timeInterval",
37
+ CALENDAR: "calendar",
38
+ DAILY: "daily",
39
+ WEEKLY: "weekly",
40
+ YEARLY: "yearly"
41
+ }
42
+ };
43
+ module.exports = new Proxy(enums, {
44
+ get(target, key) {
45
+ if (key in target) return target[key];
46
+ if (key.endsWith("Listener")) return noopListener;
47
+ return noop;
48
+ }
49
+ });
50
+ }
51
+ //# sourceMappingURL=expo-notifications-stub.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "miaoda-expo-devkit",
3
- "version": "0.1.1-beta.16",
3
+ "version": "0.1.1-beta.17",
4
4
  "description": "Expo 应用开发工具集:Sentry DSN 替换 stub、错误/网络捕获、Metro 符号化",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
@@ -40,6 +40,7 @@
40
40
  },
41
41
  "./sentry-react-native-stub": "./dist/stubs/sentry-react-native-stub.js",
42
42
  "./no-op-logbox": "./dist/stubs/no-op-logbox.js",
43
+ "./expo-notifications-stub": "./dist/stubs/expo-notifications-stub.js",
43
44
  "./rules/no-undeclared-expo-plugin": "./dist/rules/no-undeclared-expo-plugin.js",
44
45
  "./rules/no-unused-expo-plugin": "./dist/rules/no-unused-expo-plugin.js",
45
46
  "./rules/no-unstable-expo-router": "./dist/rules/no-unstable-expo-router.js",