Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: enable pnpm mode #2811

Merged
merged 3 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/funny-ducks-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
33 changes: 33 additions & 0 deletions .yarn/patches/react-native-macos-npm-0.72.7-e19b4d7895.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff --git a/scripts/cocoapods/codegen.rb b/scripts/cocoapods/codegen.rb
index 56d120fcceda051e8bdda6f0af63dcf2dd16d4a6..674d48d12ca0a867094052394273a255d2005143 100644
--- a/scripts/cocoapods/codegen.rb
+++ b/scripts/cocoapods/codegen.rb
@@ -11,23 +11,12 @@
# - dir_manager: a class that implements the `Dir` interface. Defaults to `Dir`, the Dependency can be injected for testing purposes.
# @throws an error if it could not find the codegen folder.
def build_codegen!(react_native_path, relative_installation_root, dir_manager: Dir)
- codegen_repo_path = "#{relative_installation_root}/#{react_native_path}/../react-native-codegen";
- codegen_npm_path = "#{relative_installation_root}/#{react_native_path}/../@react-native/codegen";
- codegen_cli_path = ""
+ codegen_repo_path = "#{relative_installation_root}/#{react_native_path}/../react-native-codegen"
+ return unless dir_manager.exist?(codegen_repo_path) && !dir_manager.exist?("#{codegen_repo_path}/lib")

- if dir_manager.exist?(codegen_repo_path)
- codegen_cli_path = codegen_repo_path
- elsif dir_manager.exist?(codegen_npm_path)
- codegen_cli_path = codegen_npm_path
- else
- raise "[codegen] Could not find react-native-codegen."
- end
-
- if !dir_manager.exist?("#{codegen_cli_path}/lib")
- Pod::UI.puts "[Codegen] building #{codegen_cli_path}."
- system("#{codegen_cli_path}/scripts/oss/build.sh")
- end
- end
+ Pod::UI.puts "[Codegen] building #{codegen_repo_path}"
+ system("#{codegen_repo_path}/scripts/oss/build.sh")
+end

# It generates an empty `ThirdPartyProvider`, required by Fabric to load the components
#
33 changes: 33 additions & 0 deletions .yarn/patches/react-native-npm-0.72.6-9d6fdd645f.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff --git a/scripts/cocoapods/codegen.rb b/scripts/cocoapods/codegen.rb
index 56d120fcceda051e8bdda6f0af63dcf2dd16d4a6..674d48d12ca0a867094052394273a255d2005143 100644
--- a/scripts/cocoapods/codegen.rb
+++ b/scripts/cocoapods/codegen.rb
@@ -11,23 +11,12 @@
# - dir_manager: a class that implements the `Dir` interface. Defaults to `Dir`, the Dependency can be injected for testing purposes.
# @throws an error if it could not find the codegen folder.
def build_codegen!(react_native_path, relative_installation_root, dir_manager: Dir)
- codegen_repo_path = "#{relative_installation_root}/#{react_native_path}/../react-native-codegen";
- codegen_npm_path = "#{relative_installation_root}/#{react_native_path}/../@react-native/codegen";
- codegen_cli_path = ""
+ codegen_repo_path = "#{relative_installation_root}/#{react_native_path}/../react-native-codegen"
+ return unless dir_manager.exist?(codegen_repo_path) && !dir_manager.exist?("#{codegen_repo_path}/lib")

- if dir_manager.exist?(codegen_repo_path)
- codegen_cli_path = codegen_repo_path
- elsif dir_manager.exist?(codegen_npm_path)
- codegen_cli_path = codegen_npm_path
- else
- raise "[codegen] Could not find react-native-codegen."
- end
-
- if !dir_manager.exist?("#{codegen_cli_path}/lib")
- Pod::UI.puts "[Codegen] building #{codegen_cli_path}."
- system("#{codegen_cli_path}/scripts/oss/build.sh")
- end
- end
+ Pod::UI.puts "[Codegen] building #{codegen_repo_path}"
+ system("#{codegen_repo_path}/scripts/oss/build.sh")
+end

# It generates an empty `ThirdPartyProvider`, required by Fabric to load the components
#
9 changes: 8 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ logFilters:
level: discard
- code: YN0013 # X can't be found in the cache and will be fetched from the remote registry
level: discard
nodeLinker: node-modules
nodeLinker: pnpm
npmRegistryServer: "https://registry.npmjs.org"
packageExtensions:
"@fluentui/utilities@*":
Expand All @@ -17,6 +17,13 @@ packageExtensions:
"@microsoft/[email protected]":
peerDependencies:
eslint: ">=5.16.0"
"@react-native-community/cli-debugger-ui@*":
dependencies:
"@babel/runtime": "^7.20.0"
"@react-native/codegen@*":
dependencies:
glob: "^7.1.1"
invariant: "^2.2.4"
babel-plugin-transform-flow-enums@*:
peerDependencies:
"@babel/core": ^7.20.0
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,17 @@
"@react-native-community/cli": "^11.3.6",
"@react-native-community/cli-platform-android": "^11.3.6",
"@react-native-community/cli-platform-ios": "^11.3.6",
"@rnx-kit/react-native-host": "workspace:*",
"@vue/compiler-sfc": "link:./incubator/ignore",
"depcheck/@babel/parser": "~7.23.0",
"depcheck/@babel/traverse": "~7.23.0",
"deprecated-react-native-prop-types/@react-native/normalize-colors": "^0.72.0",
"nx/glob": "^7.1.4",
"nx/minimatch": "^3.0.5",
"nx/semver": "^7.3.5",
"react-native-windows/metro-source-map": "^0.76.8"
"react-native-macos@^0.72.0": "patch:react-native-macos@npm%3A0.72.7#./.yarn/patches/react-native-macos-npm-0.72.7-e19b4d7895.patch",
"react-native-windows/metro-source-map": "^0.76.8",
"react-native@^0.72.0": "patch:react-native@npm%3A0.72.6#./.yarn/patches/react-native-npm-0.72.6-9d6fdd645f.patch"
},
"workspaces": {
"packages": [
Expand Down
4 changes: 2 additions & 2 deletions packages/test-app/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
def androidTestAppDir = "../../../node_modules/react-native-test-app/android"
def androidTestAppDir = "../node_modules/react-native-test-app/android"
apply(from: "${androidTestAppDir}/dependencies.gradle")

repositories {
Expand All @@ -18,7 +18,7 @@ allprojects {
repositories {
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("${rootDir}/../../../node_modules/react-native/android")
url("${rootDir}/../node_modules/react-native/android")
}
mavenCentral()
google()
Expand Down
2 changes: 1 addition & 1 deletion packages/test-app/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ pluginManagement {

rootProject.name = "example"

apply(from: "../../../node_modules/react-native-test-app/test-app.gradle")
apply(from: "../node_modules/react-native-test-app/test-app.gradle")
applyTestAppSettings(settings)
2 changes: 1 addition & 1 deletion packages/test-app/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
platform :ios, '14.0'

require_relative '../../../node_modules/react-native-test-app/test_app'
require_relative '../node_modules/react-native-test-app/test_app'

workspace 'SampleCrossApp.xcworkspace'

Expand Down
Loading