Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(align-deps): introduce preset with New Arch packages
- Loading branch information
Showing
5 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@rnx-kit/align-deps": minor | ||
--- | ||
|
||
Added a preset containing only packages that are compatible with New Architecture |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/align-deps/src/presets/community/react-native-new-arch-only.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import type { Preset } from "../../types"; | ||
import profile_0_70 from "./react-native-new-arch-only/profile-0.70"; | ||
|
||
// Also export this by name for scripts to work around a bug where this module | ||
// is wrapped twice, i.e. `{ default: { default: preset } }`, when imported as | ||
// ESM. | ||
export const preset: Readonly<Preset> = { | ||
"0.70": profile_0_70, | ||
}; | ||
|
||
export default preset; |
58 changes: 58 additions & 0 deletions
58
packages/align-deps/src/presets/community/react-native-new-arch-only/profile-0.70.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import type { Capability } from "@rnx-kit/config"; | ||
import type { Profile } from "../../../types"; | ||
import profile_0_70 from "../../microsoft/react-native/profile-0.70"; | ||
|
||
const profile: Profile = { | ||
...profile_0_70, | ||
animation: { | ||
name: "react-native-reanimated", | ||
version: "^3.0.0-0", | ||
}, | ||
// @ts-expect-error 'blur' is not a known capability | ||
blur: { | ||
name: "@react-native-community/blur", | ||
version: "^4.3.0", | ||
}, | ||
// gestures: already in the default profile | ||
"linear-gradient": { | ||
name: "rnx-gradient", | ||
version: "^0.1.0", | ||
}, | ||
// safe-area: already in the default profile | ||
// screens: already in the default profile | ||
slider: { | ||
name: "react-native-slider", | ||
version: "^4.3.1", | ||
}, | ||
svg: { | ||
name: "react-native-svg", | ||
version: "^13.5.0", | ||
}, | ||
// "test-app": already in the default profile, | ||
}; | ||
|
||
const unsupportedCapabilities: Capability[] = [ | ||
"base64", | ||
"checkbox", | ||
"clipboard", | ||
"datetime-picker", | ||
"filesystem", | ||
"floating-action", | ||
"html", | ||
"masked-view", | ||
"modal", | ||
"navigation/native", | ||
"navigation/stack", | ||
"netinfo", | ||
"popover", | ||
"shimmer", | ||
"sqlite", | ||
"storage", | ||
"webview", | ||
]; | ||
|
||
unsupportedCapabilities.forEach((capability) => { | ||
delete profile[capability]; | ||
}); | ||
|
||
export default profile; |