Conversation
|
|
||
| const CP_R_OPTIONS = { force: true, recursive: true }; | ||
| const MKDIR_P_OPTIONS = { recursive: true, mode: 0o755 }; | ||
| const RM_R_OPTIONS = { force: true, maxRetries: 3, recursive: true }; |
There was a problem hiding this comment.
Curious, have you found that you actually need the retries?
There was a problem hiding this comment.
I see it comes from previous uses
There was a problem hiding this comment.
I think this is mostly intended for Windows where a file can be locked.
JasonVMo
left a comment
There was a problem hiding this comment.
I left a few comments but they are all effectively suggestions, nothing that blocks merging this. Feel free to address them or consider them for a future PR.
| * @param {string} source | ||
| * @param {string} destination | ||
| */ | ||
| export function cp_r(source, destination, fs = nodefs) { |
There was a problem hiding this comment.
At first I was concerned that the names here don't reflect the synchronous behavior, but once I realized the naming pattern was aligning with the shell commands it is fine. Maybe consider renaming the file to something like fsSync.mjs or filesystemSync.mjs to reflect this? Just something to consider, but for an internal script package not a requirement.
| * @import { ProjectConfiguration } from "./xcode.mjs"; | ||
| */ | ||
|
|
||
| const SUPPORTED_PLATFORMS = ["ios", "macos", "visionos"]; |
There was a problem hiding this comment.
Consider moving this to a more shared location as SUPPORTED_APPLE_PLATFORMS.
| * @param {ApplePlatform} targetPlatform | ||
| * @returns {string} | ||
| */ | ||
| function findReactNativePath( |
There was a problem hiding this comment.
This feels shared, not really apple or ios specific.
There was a problem hiding this comment.
I will move it to a more central place once the iOS stuff is done and working. I will have to go over the Android and Windows scripts to make sure we share as much as possible.
| * @param {string} p | ||
| * @returns {number} | ||
| */ | ||
| function readPackageVersion(p, fs = nodefs) { |
There was a problem hiding this comment.
Maybe use the @rnx-kit/tools-package stuff for some of this? I haven't looked through all the code but it feels like we probably load the package.json multiple times.
There was a problem hiding this comment.
This one is slightly different because we already have the location of the package and we just want to read the manifest. Not sure it makes sense outside of how we currently use it inside these scripts. But I will move it to a more central place once the iOS stuff is done and working. I will have to go over the Android and Windows scripts to make sure we share as much as possible.
ios/xcode.mjs
Outdated
| * buildSettings: Record<string, string | string[]>; | ||
| * testsBuildSettings: Record<string, string>; | ||
| * uitestsBuildSettings: Record<string, string>; | ||
| * }} ProjectConfiguration |
There was a problem hiding this comment.
Maybe manually create and check-in a .d.ts file with types like this? Feels dangerous to have something this complex defined inline like this.
There was a problem hiding this comment.
We do have a types.ts. Moved the type there.
|
|
||
| preprocessors.push(`REACT_NATIVE_VERSION=${reactNativeVersion}`); | ||
|
|
||
| // In Xcode 15, `unary_function` and `binary_function` are no longer provided |
There was a problem hiding this comment.
I know this is a port, but maybe we wont' need this eventually as Xcode N - 1 support is quite quick to drop.
There was a problem hiding this comment.
It's the other way around. As long as we support older versions of React Native, we will need this workaround.
test/ios/newArch.test.ts
Outdated
| }); | ||
|
|
||
| it("does not return true just because `RCT_NEW_ARCH_ENABLED` is set", () => { | ||
| // `RCT_NEW_ARCH_ENABLED` does not enable bridgeless |
There was a problem hiding this comment.
Not on older versions. Will update comment.
Description
Port
make_project!to JS and add tests for supporting code. Tests formake_project!will be added in a separate PR.Platforms affected
Test plan