@teardown/cli 2.0.60 → 2.0.62
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/package.json +2 -2
- package/templates/metro.config.js +30 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teardown/cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.62",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@biomejs/biome": "2.3.11",
|
|
74
|
-
"@teardown/tsconfig": "2.0.
|
|
74
|
+
"@teardown/tsconfig": "2.0.62",
|
|
75
75
|
"@types/bun": "1.3.5",
|
|
76
76
|
"@types/ejs": "^3.1.5",
|
|
77
77
|
"typescript": "5.9.3"
|
|
@@ -25,7 +25,7 @@ const { getDefaultConfig, mergeConfig } = require("@react-native/metro-config");
|
|
|
25
25
|
*/
|
|
26
26
|
const config = {};
|
|
27
27
|
|
|
28
|
-
// First apply Teardown config, then Navigation
|
|
28
|
+
// First apply Teardown config, then Navigation
|
|
29
29
|
const teardownConfig = withTeardown(mergeConfig(getDefaultConfig(__dirname), config));
|
|
30
30
|
|
|
31
31
|
const navigationConfig = withTeardownNavigation(teardownConfig, {
|
|
@@ -35,7 +35,35 @@ const navigationConfig = withTeardownNavigation(teardownConfig, {
|
|
|
35
35
|
verbose: false,
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Wrap resolvers with null-handling before Uniwind.
|
|
40
|
+
* Uniwind doesn't handle null returns from resolvers, so we ensure
|
|
41
|
+
* any null returns are converted to Metro's default resolution.
|
|
42
|
+
*/
|
|
43
|
+
const withNullSafeResolver = (inputConfig) => {
|
|
44
|
+
const existingResolver = inputConfig.resolver?.resolveRequest;
|
|
45
|
+
if (!existingResolver) return inputConfig;
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
...inputConfig,
|
|
49
|
+
resolver: {
|
|
50
|
+
...inputConfig.resolver,
|
|
51
|
+
resolveRequest: (context, moduleName, platform) => {
|
|
52
|
+
const result = existingResolver(context, moduleName, platform);
|
|
53
|
+
// If resolver returns null, use Metro's internal resolver
|
|
54
|
+
if (result === null) {
|
|
55
|
+
return context.resolveRequest(context, moduleName, platform);
|
|
56
|
+
}
|
|
57
|
+
return result;
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// Apply null-safe wrapper before Uniwind (which expects non-null results)
|
|
64
|
+
const safeConfig = withNullSafeResolver(navigationConfig);
|
|
65
|
+
|
|
66
|
+
module.exports = withUniwindConfig(safeConfig, {
|
|
39
67
|
cssEntryFile: "./src/global.css",
|
|
40
68
|
dtsFile: "./src/uniwind-types.d.ts",
|
|
41
69
|
});
|