miaoda-expo-devkit 0.1.1-beta.10 → 0.1.1-beta.12
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 +10 -2
- package/dist/metro.d.ts +10 -2
- package/dist/metro.js +18 -2
- package/dist/metro.mjs +18 -2
- package/dist/stubs/expo-blur-stub.js +29 -0
- package/dist/stubs/expo-linear-gradient-stub.js +28 -0
- package/dist/stubs/react-native-reanimated-stub.js +32 -0
- package/package.json +9 -1
package/dist/metro.d.mts
CHANGED
|
@@ -229,6 +229,12 @@ declare function withWorkspaceNodeModules(config: MetroConfig): MetroConfig;
|
|
|
229
229
|
* 当前支持的包:
|
|
230
230
|
* - expo-image:Image 组件(className → style)
|
|
231
231
|
* - expo-camera:CameraView 组件(className → style)
|
|
232
|
+
* - expo-linear-gradient:LinearGradient 组件(className → style)
|
|
233
|
+
* - expo-blur:BlurView / BlurTargetView 组件(className → style)
|
|
234
|
+
* - react-native-reanimated:Animated.View / ScrollView / Text / Image / FlatList(className → style)
|
|
235
|
+
*
|
|
236
|
+
* 注意:expo-video 的 VideoView 在 web 上直接渲染 DOM <video> 元素,不经过 RN 样式系统,
|
|
237
|
+
* cssInterop/remapProps 均无效,不做拦截。需要 className 时请用 View 包裹 VideoView。
|
|
232
238
|
*
|
|
233
239
|
* 此函数在开发和生产环境均需启用(cssInterop 注册与环境无关)。
|
|
234
240
|
* 支持与其他 Metro wrapper 链式组合。
|
|
@@ -250,9 +256,11 @@ declare function withCssInterop(config: MetroConfig): MetroConfig;
|
|
|
250
256
|
* 将 Metro transformer 的 minifier 切换为 esbuild。
|
|
251
257
|
*
|
|
252
258
|
* esbuild 比 terser 快数十倍,内存占用极低,非常适合 web 生产构建。
|
|
253
|
-
*
|
|
259
|
+
* 通过 metro-minify-esbuild 桥接,pnpm 会将 esbuild 作为其 peer dep 一并安装,
|
|
260
|
+
* 解析路径在 devkit 上下文中(metro.config.js 加载时)完成。
|
|
254
261
|
*
|
|
255
|
-
*
|
|
262
|
+
* 注意:切换 minifier 时必须清空 minifierConfig,因为默认 config 含有
|
|
263
|
+
* terser 专属选项(如 mangle、compress 等),传给 esbuild 会报错。
|
|
256
264
|
*/
|
|
257
265
|
declare function withEsbuildMinify(config: MetroConfig): MetroConfig;
|
|
258
266
|
|
package/dist/metro.d.ts
CHANGED
|
@@ -229,6 +229,12 @@ declare function withWorkspaceNodeModules(config: MetroConfig): MetroConfig;
|
|
|
229
229
|
* 当前支持的包:
|
|
230
230
|
* - expo-image:Image 组件(className → style)
|
|
231
231
|
* - expo-camera:CameraView 组件(className → style)
|
|
232
|
+
* - expo-linear-gradient:LinearGradient 组件(className → style)
|
|
233
|
+
* - expo-blur:BlurView / BlurTargetView 组件(className → style)
|
|
234
|
+
* - react-native-reanimated:Animated.View / ScrollView / Text / Image / FlatList(className → style)
|
|
235
|
+
*
|
|
236
|
+
* 注意:expo-video 的 VideoView 在 web 上直接渲染 DOM <video> 元素,不经过 RN 样式系统,
|
|
237
|
+
* cssInterop/remapProps 均无效,不做拦截。需要 className 时请用 View 包裹 VideoView。
|
|
232
238
|
*
|
|
233
239
|
* 此函数在开发和生产环境均需启用(cssInterop 注册与环境无关)。
|
|
234
240
|
* 支持与其他 Metro wrapper 链式组合。
|
|
@@ -250,9 +256,11 @@ declare function withCssInterop(config: MetroConfig): MetroConfig;
|
|
|
250
256
|
* 将 Metro transformer 的 minifier 切换为 esbuild。
|
|
251
257
|
*
|
|
252
258
|
* esbuild 比 terser 快数十倍,内存占用极低,非常适合 web 生产构建。
|
|
253
|
-
*
|
|
259
|
+
* 通过 metro-minify-esbuild 桥接,pnpm 会将 esbuild 作为其 peer dep 一并安装,
|
|
260
|
+
* 解析路径在 devkit 上下文中(metro.config.js 加载时)完成。
|
|
254
261
|
*
|
|
255
|
-
*
|
|
262
|
+
* 注意:切换 minifier 时必须清空 minifierConfig,因为默认 config 含有
|
|
263
|
+
* terser 专属选项(如 mangle、compress 等),传给 esbuild 会报错。
|
|
256
264
|
*/
|
|
257
265
|
declare function withEsbuildMinify(config: MetroConfig): MetroConfig;
|
|
258
266
|
|
package/dist/metro.js
CHANGED
|
@@ -251,6 +251,12 @@ var EXPO_IMAGE_STUB_FILENAME = "expo-image-stub.js";
|
|
|
251
251
|
var EXPO_IMAGE_STUB_PATH = import_path6.default.resolve(__dirname, "stubs", EXPO_IMAGE_STUB_FILENAME);
|
|
252
252
|
var EXPO_CAMERA_STUB_FILENAME = "expo-camera-stub.js";
|
|
253
253
|
var EXPO_CAMERA_STUB_PATH = import_path6.default.resolve(__dirname, "stubs", EXPO_CAMERA_STUB_FILENAME);
|
|
254
|
+
var EXPO_LINEAR_GRADIENT_STUB_FILENAME = "expo-linear-gradient-stub.js";
|
|
255
|
+
var EXPO_LINEAR_GRADIENT_STUB_PATH = import_path6.default.resolve(__dirname, "stubs", EXPO_LINEAR_GRADIENT_STUB_FILENAME);
|
|
256
|
+
var REANIMATED_STUB_FILENAME = "react-native-reanimated-stub.js";
|
|
257
|
+
var REANIMATED_STUB_PATH = import_path6.default.resolve(__dirname, "stubs", REANIMATED_STUB_FILENAME);
|
|
258
|
+
var EXPO_BLUR_STUB_FILENAME = "expo-blur-stub.js";
|
|
259
|
+
var EXPO_BLUR_STUB_PATH = import_path6.default.resolve(__dirname, "stubs", EXPO_BLUR_STUB_FILENAME);
|
|
254
260
|
function withCssInterop(config) {
|
|
255
261
|
const upstream = config.resolver?.resolveRequest ?? null;
|
|
256
262
|
const resolveRequest = (context, moduleName, platform) => {
|
|
@@ -260,6 +266,15 @@ function withCssInterop(config) {
|
|
|
260
266
|
if (moduleName === "expo-camera" && !context.originModulePath.includes(EXPO_CAMERA_STUB_FILENAME)) {
|
|
261
267
|
return { filePath: EXPO_CAMERA_STUB_PATH, type: "sourceFile" };
|
|
262
268
|
}
|
|
269
|
+
if (moduleName === "expo-linear-gradient" && !context.originModulePath.includes(EXPO_LINEAR_GRADIENT_STUB_FILENAME)) {
|
|
270
|
+
return { filePath: EXPO_LINEAR_GRADIENT_STUB_PATH, type: "sourceFile" };
|
|
271
|
+
}
|
|
272
|
+
if (moduleName === "react-native-reanimated" && !context.originModulePath.includes(REANIMATED_STUB_FILENAME)) {
|
|
273
|
+
return { filePath: REANIMATED_STUB_PATH, type: "sourceFile" };
|
|
274
|
+
}
|
|
275
|
+
if (moduleName === "expo-blur" && !context.originModulePath.includes(EXPO_BLUR_STUB_FILENAME)) {
|
|
276
|
+
return { filePath: EXPO_BLUR_STUB_PATH, type: "sourceFile" };
|
|
277
|
+
}
|
|
263
278
|
if (upstream) {
|
|
264
279
|
return upstream(context, moduleName, platform);
|
|
265
280
|
}
|
|
@@ -283,8 +298,9 @@ function withEsbuildMinify(config) {
|
|
|
283
298
|
...config,
|
|
284
299
|
transformer: {
|
|
285
300
|
...config.transformer,
|
|
286
|
-
|
|
287
|
-
|
|
301
|
+
minifierPath: require.resolve("metro-minify-esbuild"),
|
|
302
|
+
// 清空 terser 默认选项,esbuild 用自己的默认压缩配置
|
|
303
|
+
minifierConfig: {}
|
|
288
304
|
}
|
|
289
305
|
};
|
|
290
306
|
}
|
package/dist/metro.mjs
CHANGED
|
@@ -214,6 +214,12 @@ var EXPO_IMAGE_STUB_FILENAME = "expo-image-stub.js";
|
|
|
214
214
|
var EXPO_IMAGE_STUB_PATH = path6.resolve(__dirname, "stubs", EXPO_IMAGE_STUB_FILENAME);
|
|
215
215
|
var EXPO_CAMERA_STUB_FILENAME = "expo-camera-stub.js";
|
|
216
216
|
var EXPO_CAMERA_STUB_PATH = path6.resolve(__dirname, "stubs", EXPO_CAMERA_STUB_FILENAME);
|
|
217
|
+
var EXPO_LINEAR_GRADIENT_STUB_FILENAME = "expo-linear-gradient-stub.js";
|
|
218
|
+
var EXPO_LINEAR_GRADIENT_STUB_PATH = path6.resolve(__dirname, "stubs", EXPO_LINEAR_GRADIENT_STUB_FILENAME);
|
|
219
|
+
var REANIMATED_STUB_FILENAME = "react-native-reanimated-stub.js";
|
|
220
|
+
var REANIMATED_STUB_PATH = path6.resolve(__dirname, "stubs", REANIMATED_STUB_FILENAME);
|
|
221
|
+
var EXPO_BLUR_STUB_FILENAME = "expo-blur-stub.js";
|
|
222
|
+
var EXPO_BLUR_STUB_PATH = path6.resolve(__dirname, "stubs", EXPO_BLUR_STUB_FILENAME);
|
|
217
223
|
function withCssInterop(config) {
|
|
218
224
|
const upstream = config.resolver?.resolveRequest ?? null;
|
|
219
225
|
const resolveRequest = (context, moduleName, platform) => {
|
|
@@ -223,6 +229,15 @@ function withCssInterop(config) {
|
|
|
223
229
|
if (moduleName === "expo-camera" && !context.originModulePath.includes(EXPO_CAMERA_STUB_FILENAME)) {
|
|
224
230
|
return { filePath: EXPO_CAMERA_STUB_PATH, type: "sourceFile" };
|
|
225
231
|
}
|
|
232
|
+
if (moduleName === "expo-linear-gradient" && !context.originModulePath.includes(EXPO_LINEAR_GRADIENT_STUB_FILENAME)) {
|
|
233
|
+
return { filePath: EXPO_LINEAR_GRADIENT_STUB_PATH, type: "sourceFile" };
|
|
234
|
+
}
|
|
235
|
+
if (moduleName === "react-native-reanimated" && !context.originModulePath.includes(REANIMATED_STUB_FILENAME)) {
|
|
236
|
+
return { filePath: REANIMATED_STUB_PATH, type: "sourceFile" };
|
|
237
|
+
}
|
|
238
|
+
if (moduleName === "expo-blur" && !context.originModulePath.includes(EXPO_BLUR_STUB_FILENAME)) {
|
|
239
|
+
return { filePath: EXPO_BLUR_STUB_PATH, type: "sourceFile" };
|
|
240
|
+
}
|
|
226
241
|
if (upstream) {
|
|
227
242
|
return upstream(context, moduleName, platform);
|
|
228
243
|
}
|
|
@@ -246,8 +261,9 @@ function withEsbuildMinify(config) {
|
|
|
246
261
|
...config,
|
|
247
262
|
transformer: {
|
|
248
263
|
...config.transformer,
|
|
249
|
-
|
|
250
|
-
|
|
264
|
+
minifierPath: __require.resolve("metro-minify-esbuild"),
|
|
265
|
+
// 清空 terser 默认选项,esbuild 用自己的默认压缩配置
|
|
266
|
+
minifierConfig: {}
|
|
251
267
|
}
|
|
252
268
|
};
|
|
253
269
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var ExpoBlur = __toESM(require("expo-blur"));
|
|
25
|
+
var import_nativewind = require("nativewind");
|
|
26
|
+
if (ExpoBlur.BlurView) (0, import_nativewind.cssInterop)(ExpoBlur.BlurView, { className: "style" });
|
|
27
|
+
if (ExpoBlur.BlurTargetView) (0, import_nativewind.cssInterop)(ExpoBlur.BlurTargetView, { className: "style" });
|
|
28
|
+
module.exports = ExpoBlur;
|
|
29
|
+
//# sourceMappingURL=expo-blur-stub.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var ExpoLinearGradient = __toESM(require("expo-linear-gradient"));
|
|
25
|
+
var import_nativewind = require("nativewind");
|
|
26
|
+
(0, import_nativewind.cssInterop)(ExpoLinearGradient.LinearGradient, { className: "style" });
|
|
27
|
+
module.exports = ExpoLinearGradient;
|
|
28
|
+
//# sourceMappingURL=expo-linear-gradient-stub.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var Reanimated = __toESM(require("react-native-reanimated"));
|
|
25
|
+
var import_nativewind = require("nativewind");
|
|
26
|
+
(0, import_nativewind.cssInterop)(Reanimated.default.View, { className: "style" });
|
|
27
|
+
(0, import_nativewind.cssInterop)(Reanimated.default.ScrollView, { className: "style" });
|
|
28
|
+
(0, import_nativewind.cssInterop)(Reanimated.default.Text, { className: "style" });
|
|
29
|
+
(0, import_nativewind.cssInterop)(Reanimated.default.Image, { className: "style" });
|
|
30
|
+
(0, import_nativewind.cssInterop)(Reanimated.default.FlatList, { className: "style" });
|
|
31
|
+
module.exports = Reanimated;
|
|
32
|
+
//# sourceMappingURL=react-native-reanimated-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.
|
|
3
|
+
"version": "0.1.1-beta.12",
|
|
4
4
|
"description": "Expo 应用开发工具集:Sentry DSN 替换 stub、错误/网络捕获、Metro 符号化",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -79,6 +79,14 @@
|
|
|
79
79
|
"@sentry/react-native": ">=8.0.0",
|
|
80
80
|
"react-native": ">=0.72.0"
|
|
81
81
|
},
|
|
82
|
+
"peerDependenciesMeta": {
|
|
83
|
+
"@sentry/core": {
|
|
84
|
+
"optional": true
|
|
85
|
+
},
|
|
86
|
+
"@sentry/react-native": {
|
|
87
|
+
"optional": true
|
|
88
|
+
}
|
|
89
|
+
},
|
|
82
90
|
"publishConfig": {
|
|
83
91
|
"registry": "https://registry.npmjs.org/",
|
|
84
92
|
"access": "public"
|