From aa114d3fe30f9a26b33c7c5ea63b16898c1c5080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81opaci=C5=84ski?= Date: Wed, 22 Jan 2025 18:11:44 +0100 Subject: [PATCH 01/17] Clean up fabric example deps --- apps/common-app/package.json | 71 +++++++------- .../examples/WithoutBabelPluginExample.tsx | 8 +- apps/fabric-example/package.json | 59 +----------- apps/fabric-example/react-native.config.js | 22 ++++- yarn.lock | 93 +++++-------------- 5 files changed, 81 insertions(+), 172 deletions(-) diff --git a/apps/common-app/package.json b/apps/common-app/package.json index d723cb966d31..ececc21993f4 100644 --- a/apps/common-app/package.json +++ b/apps/common-app/package.json @@ -10,41 +10,51 @@ "type:check": "tsc --noEmit" }, "peerDependencies": { - "@react-native-async-storage/async-storage": "*", - "@react-native-clipboard/clipboard": "*", - "@react-native-community/slider": "*", - "@react-native-masked-view/masked-view": "*", - "@react-navigation/bottom-tabs": "*", - "@react-navigation/native": "*", - "@react-navigation/native-stack": "*", - "@react-navigation/stack": "*", - "@shopify/flash-list": "*", - "d3-shape": "*", - "react": "*", - "react-dom": "*", - "react-native": "*", - "react-native-gesture-handler": "*", - "react-native-pager-view": "*", - "react-native-reanimated": "*", - "react-native-safe-area-context": "*", - "react-native-screens": "*", - "react-native-svg": "*", - "react-native-web": "*", - "react-strict-dom": "*" + "react-native": "*" }, - "devDependencies": { + "dependencies": { + "@fortawesome/fontawesome-svg-core": "^6.5.2", + "@fortawesome/free-solid-svg-icons": "^6.5.2", + "@fortawesome/react-native-fontawesome": "^0.3.2", + "@gorhom/portal": "^1.0.14", "@react-native-async-storage/async-storage": "2.1.0", "@react-native-clipboard/clipboard": "^1.15.0", "@react-native-community/slider": "4.5.5", "@react-native-masked-view/masked-view": "0.3.2", "@react-navigation/bottom-tabs": "^7.0.0", + "@react-navigation/drawer": "^7.1.1", "@react-navigation/native": "^7.0.14", "@react-navigation/native-stack": "^7.0.0", "@react-navigation/stack": "^7.1.1", "@shopify/flash-list": "patch:@shopify/flash-list@npm%3A1.7.2#~/.yarn/patches/@shopify-flash-list-npm-1.7.2-2a363895ca.patch", + "d3-shape": "^3.2.0", + "eslint-plugin-reanimated": "workspace:*", + "react": "18.3.1", + "react-native": "0.77.0-rc.6", + "react-native-gesture-handler": "2.22.0", + "react-native-pager-view": "6.6.1", + "react-native-reanimated": "workspace:*", + "react-native-safe-area-context": "5.1.0", + "react-native-screens": "4.5.0", + "react-native-svg": "15.11.1", + "react-strict-dom": "0.0.27" + }, + "devDependencies": { + "@babel/core": "^7.25.2", + "@babel/preset-env": "^7.25.3", + "@babel/runtime": "^7.25.0", + "@react-native-community/cli": "15.0.1", + "@react-native-community/cli-platform-android": "15.0.1", + "@react-native-community/cli-platform-ios": "15.0.1", + "@react-native/babel-preset": "0.77.0-rc.6", + "@react-native/eslint-config": "0.77.0-rc.6", + "@react-native/metro-config": "0.77.0-rc.6", + "@react-native/typescript-config": "0.77.0-rc.6", "@tsconfig/react-native": "^3.0.0", "@types/d3-shape": "^3.1.1", - "d3-shape": "^3.2.0", + "@types/jest": "^29.5.13", + "@types/react": "^18.2.6", + "@types/react-test-renderer": "^18.0.0", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-import-resolver-typescript": "^3.6.3", @@ -53,19 +63,14 @@ "eslint-plugin-perfectionist": "^2.1.0", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-react-hooks": "^5.0.0", - "eslint-plugin-reanimated": "workspace:*", + "eslint-plugin-simple-import-sort": "^12.1.1", + "eslint-plugin-unused-imports": "^4.1.4", + "jest": "^29.6.3", "madge": "^5.0.1", "patch-package": "^8.0.0", "prettier": "^3.3.3", - "react": "18.3.1", - "react-native": "0.77.0-rc.6", - "react-native-gesture-handler": "2.22.0", - "react-native-pager-view": "6.6.1", - "react-native-reanimated": "workspace:*", - "react-native-safe-area-context": "5.1.0", - "react-native-screens": "4.5.0", - "react-native-svg": "15.11.1", - "react-strict-dom": "0.0.27", + "react-native-monorepo-tools": "^1.2.1", + "react-test-renderer": "18.3.1", "typescript": "~5.3.0", "typescript-eslint": "^8.12.2" } diff --git a/apps/common-app/src/apps/reanimated/examples/WithoutBabelPluginExample.tsx b/apps/common-app/src/apps/reanimated/examples/WithoutBabelPluginExample.tsx index bbecc76eec1d..850176bc7453 100644 --- a/apps/common-app/src/apps/reanimated/examples/WithoutBabelPluginExample.tsx +++ b/apps/common-app/src/apps/reanimated/examples/WithoutBabelPluginExample.tsx @@ -4,16 +4,10 @@ import Animated, { useSharedValue, withSpring, } from 'react-native-reanimated'; -import { - Gesture, - GestureDetector, - enableExperimentalWebImplementation, -} from 'react-native-gesture-handler'; +import { Gesture, GestureDetector } from 'react-native-gesture-handler'; import React, { useEffect, useState } from 'react'; import { StyleSheet, Text, View } from 'react-native'; -enableExperimentalWebImplementation(true); - function isBabelPluginEnabled() { function worklet() { 'worklet'; diff --git a/apps/fabric-example/package.json b/apps/fabric-example/package.json index 6b86981dbb07..2f19c95b57d0 100644 --- a/apps/fabric-example/package.json +++ b/apps/fabric-example/package.json @@ -6,66 +6,11 @@ "build": "cd ios && bundle install && bundle exec pod update", "android": "react-native run-android", "ios": "react-native run-ios", - "lint": "eslint --max-warnings=0 --ignore-pattern 'common-app/' .", - "format": "prettier --write --list-different .", - "start": "react-native start", - "test": "jest" + "start": "react-native start" }, "dependencies": { - "@fortawesome/fontawesome-svg-core": "^6.5.2", - "@fortawesome/free-solid-svg-icons": "^6.5.2", - "@fortawesome/react-native-fontawesome": "^0.3.2", - "@gorhom/portal": "^1.0.14", - "@react-native-async-storage/async-storage": "2.1.0", - "@react-native-clipboard/clipboard": "^1.15.0", - "@react-native-community/slider": "4.5.5", - "@react-native-masked-view/masked-view": "0.3.2", - "@react-navigation/drawer": "^7.1.1", - "@react-navigation/native": "^7.0.14", - "@react-navigation/native-stack": "^7.0.0", - "@shopify/flash-list": "patch:@shopify/flash-list@npm%3A1.7.2#~/.yarn/patches/@shopify-flash-list-npm-1.7.2-2a363895ca.patch", "common-app": "workspace:*", - "react": "18.3.1", - "react-native": "0.77.0-rc.6", - "react-native-gesture-handler": "2.22.0", - "react-native-pager-view": "6.6.1", - "react-native-reanimated": "workspace:*", - "react-native-safe-area-context": "5.1.0", - "react-native-screens": "4.5.0", - "react-native-svg": "15.11.1" - }, - "devDependencies": { - "@babel/core": "^7.25.2", - "@babel/preset-env": "^7.25.3", - "@babel/runtime": "^7.25.0", - "@react-native-community/cli": "15.0.1", - "@react-native-community/cli-platform-android": "15.0.1", - "@react-native-community/cli-platform-ios": "15.0.1", - "@react-native/babel-preset": "0.77.0-rc.6", - "@react-native/eslint-config": "0.77.0-rc.6", - "@react-native/metro-config": "0.77.0-rc.6", - "@react-native/typescript-config": "0.77.0-rc.6", - "@types/jest": "^29.5.13", - "@types/react": "^18.2.6", - "@types/react-test-renderer": "^18.0.0", - "eslint": "^8.57.0", - "eslint-config-prettier": "^9.1.0", - "eslint-import-resolver-typescript": "^3.6.3", - "eslint-plugin-import": "^2.31.0", - "eslint-plugin-no-relative-import-paths": "patch:eslint-plugin-no-relative-import-paths@npm%3A1.5.5#~/.yarn/patches/eslint-plugin-no-relative-import-paths-npm-1.5.5-8fb4e4bf7a.patch", - "eslint-plugin-perfectionist": "^2.1.0", - "eslint-plugin-prettier": "^5.2.1", - "eslint-plugin-react-hooks": "^5.0.0", - "eslint-plugin-simple-import-sort": "^12.1.1", - "eslint-plugin-unused-imports": "^4.1.4", - "jest": "^29.6.3", - "madge": "^5.0.1", - "patch-package": "^8.0.0", - "prettier": "^3.3.3", - "react-native-monorepo-tools": "^1.2.1", - "react-test-renderer": "18.3.1", - "typescript": "~5.3.0", - "typescript-eslint": "^8.12.2" + "react-native": "0.77.0-rc.6" }, "engines": { "node": ">=18" diff --git a/apps/fabric-example/react-native.config.js b/apps/fabric-example/react-native.config.js index a14e68527737..f855e38e9017 100644 --- a/apps/fabric-example/react-native.config.js +++ b/apps/fabric-example/react-native.config.js @@ -1,8 +1,20 @@ -/** @type {import('@react-native-community/cli-types').Config} */ +/** + * This file is required to properly resolve native dependencies + */ +const path = require('path'); + +const commonAppDir = path.resolve(__dirname, '../common-app'); +const commonAppPkg = require(path.resolve(commonAppDir, 'package.json')); + +const dependencies = Object.fromEntries([ + // Include all common-app dependencies + ...Object.keys(commonAppPkg.devDependencies || {}), + ...Object.keys(commonAppPkg.dependencies || {}) +].map(name => [name, { + root: path.resolve(__dirname, `../../node_modules/${name}`) +}])); + module.exports = { - project: { - ios: {}, - android: {}, - }, + dependencies, assets: ['./assets/fonts/'], }; diff --git a/yarn.lock b/yarn.lock index b155b29e0942..680f6839ce8d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9353,17 +9353,35 @@ __metadata: version: 0.0.0-use.local resolution: "common-app@workspace:apps/common-app" dependencies: + "@babel/core": "npm:^7.25.2" + "@babel/preset-env": "npm:^7.25.3" + "@babel/runtime": "npm:^7.25.0" + "@fortawesome/fontawesome-svg-core": "npm:^6.5.2" + "@fortawesome/free-solid-svg-icons": "npm:^6.5.2" + "@fortawesome/react-native-fontawesome": "npm:^0.3.2" + "@gorhom/portal": "npm:^1.0.14" "@react-native-async-storage/async-storage": "npm:2.1.0" "@react-native-clipboard/clipboard": "npm:^1.15.0" + "@react-native-community/cli": "npm:15.0.1" + "@react-native-community/cli-platform-android": "npm:15.0.1" + "@react-native-community/cli-platform-ios": "npm:15.0.1" "@react-native-community/slider": "npm:4.5.5" "@react-native-masked-view/masked-view": "npm:0.3.2" + "@react-native/babel-preset": "npm:0.77.0-rc.6" + "@react-native/eslint-config": "npm:0.77.0-rc.6" + "@react-native/metro-config": "npm:0.77.0-rc.6" + "@react-native/typescript-config": "npm:0.77.0-rc.6" "@react-navigation/bottom-tabs": "npm:^7.0.0" + "@react-navigation/drawer": "npm:^7.1.1" "@react-navigation/native": "npm:^7.0.14" "@react-navigation/native-stack": "npm:^7.0.0" "@react-navigation/stack": "npm:^7.1.1" "@shopify/flash-list": "patch:@shopify/flash-list@npm%3A1.7.2#~/.yarn/patches/@shopify-flash-list-npm-1.7.2-2a363895ca.patch" "@tsconfig/react-native": "npm:^3.0.0" "@types/d3-shape": "npm:^3.1.1" + "@types/jest": "npm:^29.5.13" + "@types/react": "npm:^18.2.6" + "@types/react-test-renderer": "npm:^18.0.0" d3-shape: "npm:^3.2.0" eslint: "npm:^8.57.0" eslint-config-prettier: "npm:^9.1.0" @@ -9374,42 +9392,27 @@ __metadata: eslint-plugin-prettier: "npm:^5.2.1" eslint-plugin-react-hooks: "npm:^5.0.0" eslint-plugin-reanimated: "workspace:*" + eslint-plugin-simple-import-sort: "npm:^12.1.1" + eslint-plugin-unused-imports: "npm:^4.1.4" + jest: "npm:^29.6.3" madge: "npm:^5.0.1" patch-package: "npm:^8.0.0" prettier: "npm:^3.3.3" react: "npm:18.3.1" react-native: "npm:0.77.0-rc.6" react-native-gesture-handler: "npm:2.22.0" + react-native-monorepo-tools: "npm:^1.2.1" react-native-pager-view: "npm:6.6.1" react-native-reanimated: "workspace:*" react-native-safe-area-context: "npm:5.1.0" react-native-screens: "npm:4.5.0" react-native-svg: "npm:15.11.1" react-strict-dom: "npm:0.0.27" + react-test-renderer: "npm:18.3.1" typescript: "npm:~5.3.0" typescript-eslint: "npm:^8.12.2" peerDependencies: - "@react-native-async-storage/async-storage": "*" - "@react-native-clipboard/clipboard": "*" - "@react-native-community/slider": "*" - "@react-native-masked-view/masked-view": "*" - "@react-navigation/bottom-tabs": "*" - "@react-navigation/native": "*" - "@react-navigation/native-stack": "*" - "@react-navigation/stack": "*" - "@shopify/flash-list": "*" - d3-shape: "*" - react: "*" - react-dom: "*" react-native: "*" - react-native-gesture-handler: "*" - react-native-pager-view: "*" - react-native-reanimated: "*" - react-native-safe-area-context: "*" - react-native-screens: "*" - react-native-svg: "*" - react-native-web: "*" - react-strict-dom: "*" languageName: unknown linkType: soft @@ -12119,58 +12122,8 @@ __metadata: version: 0.0.0-use.local resolution: "fabric-example@workspace:apps/fabric-example" dependencies: - "@babel/core": "npm:^7.25.2" - "@babel/preset-env": "npm:^7.25.3" - "@babel/runtime": "npm:^7.25.0" - "@fortawesome/fontawesome-svg-core": "npm:^6.5.2" - "@fortawesome/free-solid-svg-icons": "npm:^6.5.2" - "@fortawesome/react-native-fontawesome": "npm:^0.3.2" - "@gorhom/portal": "npm:^1.0.14" - "@react-native-async-storage/async-storage": "npm:2.1.0" - "@react-native-clipboard/clipboard": "npm:^1.15.0" - "@react-native-community/cli": "npm:15.0.1" - "@react-native-community/cli-platform-android": "npm:15.0.1" - "@react-native-community/cli-platform-ios": "npm:15.0.1" - "@react-native-community/slider": "npm:4.5.5" - "@react-native-masked-view/masked-view": "npm:0.3.2" - "@react-native/babel-preset": "npm:0.77.0-rc.6" - "@react-native/eslint-config": "npm:0.77.0-rc.6" - "@react-native/metro-config": "npm:0.77.0-rc.6" - "@react-native/typescript-config": "npm:0.77.0-rc.6" - "@react-navigation/drawer": "npm:^7.1.1" - "@react-navigation/native": "npm:^7.0.14" - "@react-navigation/native-stack": "npm:^7.0.0" - "@shopify/flash-list": "patch:@shopify/flash-list@npm%3A1.7.2#~/.yarn/patches/@shopify-flash-list-npm-1.7.2-2a363895ca.patch" - "@types/jest": "npm:^29.5.13" - "@types/react": "npm:^18.2.6" - "@types/react-test-renderer": "npm:^18.0.0" common-app: "workspace:*" - eslint: "npm:^8.57.0" - eslint-config-prettier: "npm:^9.1.0" - eslint-import-resolver-typescript: "npm:^3.6.3" - eslint-plugin-import: "npm:^2.31.0" - eslint-plugin-no-relative-import-paths: "patch:eslint-plugin-no-relative-import-paths@npm%3A1.5.5#~/.yarn/patches/eslint-plugin-no-relative-import-paths-npm-1.5.5-8fb4e4bf7a.patch" - eslint-plugin-perfectionist: "npm:^2.1.0" - eslint-plugin-prettier: "npm:^5.2.1" - eslint-plugin-react-hooks: "npm:^5.0.0" - eslint-plugin-simple-import-sort: "npm:^12.1.1" - eslint-plugin-unused-imports: "npm:^4.1.4" - jest: "npm:^29.6.3" - madge: "npm:^5.0.1" - patch-package: "npm:^8.0.0" - prettier: "npm:^3.3.3" - react: "npm:18.3.1" react-native: "npm:0.77.0-rc.6" - react-native-gesture-handler: "npm:2.22.0" - react-native-monorepo-tools: "npm:^1.2.1" - react-native-pager-view: "npm:6.6.1" - react-native-reanimated: "workspace:*" - react-native-safe-area-context: "npm:5.1.0" - react-native-screens: "npm:4.5.0" - react-native-svg: "npm:15.11.1" - react-test-renderer: "npm:18.3.1" - typescript: "npm:~5.3.0" - typescript-eslint: "npm:^8.12.2" languageName: unknown linkType: soft From 6caee8a729434e7fff07a97015552bfc8329f460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81opaci=C5=84ski?= Date: Wed, 22 Jan 2025 18:25:57 +0100 Subject: [PATCH 02/17] Clean up web example deps --- apps/web-example/package.json | 33 +------------ apps/web-example/react-native.config.js | 20 ++++++++ yarn.lock | 61 +------------------------ 3 files changed, 24 insertions(+), 90 deletions(-) create mode 100644 apps/web-example/react-native.config.js diff --git a/apps/web-example/package.json b/apps/web-example/package.json index af67ba0b1965..926abecf301a 100644 --- a/apps/web-example/package.json +++ b/apps/web-example/package.json @@ -12,43 +12,14 @@ "build": "" }, "dependencies": { - "@expo/vector-icons": "^14.0.0", - "@fortawesome/fontawesome-svg-core": "^6.5.2", - "@fortawesome/free-solid-svg-icons": "^6.5.2", - "@fortawesome/react-native-fontawesome": "^0.3.2", - "@gorhom/portal": "^1.0.14", - "@react-native-async-storage/async-storage": "^1.24.0", - "@react-native-clipboard/clipboard": "^1.15.0", - "@react-navigation/drawer": "^7.1.1", - "@react-navigation/native": "^7.0.14", - "@shopify/flash-list": "patch:@shopify/flash-list@npm%3A1.7.2#~/.yarn/patches/@shopify-flash-list-npm-1.7.2-2a363895ca.patch", "common-app": "workspace:*", "expo": "^52.0.4", - "react": "18.3.1", - "react-dom": "18.3.1", - "react-native": "0.76.5", - "react-native-reanimated": "workspace:*", + "react-native": "0.77.0-rc.6", "react-native-web": "0.19.13" }, "devDependencies": { - "@babel/core": "^7.20.0", "@expo/metro-runtime": "~4.0.0", "@stylexjs/babel-plugin": "^0.10.0", - "@types/eslint": "^8", - "eslint": "^8.57.0", - "eslint-config-prettier": "^9.1.0", - "eslint-import-resolver-typescript": "^3.6.3", - "eslint-plugin-import": "^2.31.0", - "eslint-plugin-no-relative-import-paths": "patch:eslint-plugin-no-relative-import-paths@npm%3A1.5.5#~/.yarn/patches/eslint-plugin-no-relative-import-paths-npm-1.5.5-8fb4e4bf7a.patch", - "eslint-plugin-perfectionist": "^2.1.0", - "eslint-plugin-prettier": "^5.2.1", - "eslint-plugin-react-hooks": "^5.0.0", - "eslint-plugin-simple-import-sort": "^12.1.1", - "eslint-plugin-unused-imports": "^4.1.4", - "madge": "^5.0.1", - "prettier": "^3.3.3", - "serve": "^14.2.3", - "typescript": "~5.3.0", - "typescript-eslint": "^8.12.2" + "serve": "^14.2.3" } } diff --git a/apps/web-example/react-native.config.js b/apps/web-example/react-native.config.js new file mode 100644 index 000000000000..f855e38e9017 --- /dev/null +++ b/apps/web-example/react-native.config.js @@ -0,0 +1,20 @@ +/** + * This file is required to properly resolve native dependencies + */ +const path = require('path'); + +const commonAppDir = path.resolve(__dirname, '../common-app'); +const commonAppPkg = require(path.resolve(commonAppDir, 'package.json')); + +const dependencies = Object.fromEntries([ + // Include all common-app dependencies + ...Object.keys(commonAppPkg.devDependencies || {}), + ...Object.keys(commonAppPkg.dependencies || {}) +].map(name => [name, { + root: path.resolve(__dirname, `../../node_modules/${name}`) +}])); + +module.exports = { + dependencies, + assets: ['./assets/fonts/'], +}; diff --git a/yarn.lock b/yarn.lock index 680f6839ce8d..14523757c049 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4787,17 +4787,6 @@ __metadata: languageName: node linkType: hard -"@react-native-async-storage/async-storage@npm:^1.24.0": - version: 1.24.0 - resolution: "@react-native-async-storage/async-storage@npm:1.24.0" - dependencies: - merge-options: "npm:^3.0.4" - peerDependencies: - react-native: ^0.0.0-0 || >=0.60 <1.0 - checksum: 10/5a6b7ac8bd7a9e537a53a3f2301530c284fd885a45ce4a4e0014859bc0f7c89bee5c4b5a6b3740b8d83751561159b237474d18f32fad75ea7d56d4ddb2180d91 - languageName: node - linkType: hard - "@react-native-clipboard/clipboard@npm:^1.15.0": version: 1.16.1 resolution: "@react-native-clipboard/clipboard@npm:1.16.1" @@ -6741,23 +6730,6 @@ __metadata: languageName: node linkType: hard -"@types/eslint@npm:^8": - version: 8.56.12 - resolution: "@types/eslint@npm:8.56.12" - dependencies: - "@types/estree": "npm:*" - "@types/json-schema": "npm:*" - checksum: 10/bd998b5d3f98ac430ec8db6223f1cff1820774c1e72eabda05463256875d97065fd357fba7379dd25e6bfbeb73296f28faff6f4dcbc320f890bb49b09087644d - languageName: node - linkType: hard - -"@types/estree@npm:*": - version: 1.0.6 - resolution: "@types/estree@npm:1.0.6" - checksum: 10/9d35d475095199c23e05b431bcdd1f6fec7380612aed068b14b2a08aa70494de8a9026765a5a91b1073f636fb0368f6d8973f518a31391d519e20c59388ed88d - languageName: node - linkType: hard - "@types/graceful-fs@npm:^4.1.3": version: 4.1.9 resolution: "@types/graceful-fs@npm:4.1.9" @@ -6816,7 +6788,7 @@ __metadata: languageName: node linkType: hard -"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.12, @types/json-schema@npm:^7.0.9": +"@types/json-schema@npm:^7.0.12, @types/json-schema@npm:^7.0.9": version: 7.0.15 resolution: "@types/json-schema@npm:7.0.15" checksum: 10/1a3c3e06236e4c4aab89499c428d585527ce50c24fe8259e8b3926d3df4cfbbbcf306cfc73ddfb66cbafc973116efd15967020b0f738f63e09e64c7d260519e7 @@ -21909,42 +21881,13 @@ __metadata: version: 0.0.0-use.local resolution: "web-example@workspace:apps/web-example" dependencies: - "@babel/core": "npm:^7.20.0" "@expo/metro-runtime": "npm:~4.0.0" - "@expo/vector-icons": "npm:^14.0.0" - "@fortawesome/fontawesome-svg-core": "npm:^6.5.2" - "@fortawesome/free-solid-svg-icons": "npm:^6.5.2" - "@fortawesome/react-native-fontawesome": "npm:^0.3.2" - "@gorhom/portal": "npm:^1.0.14" - "@react-native-async-storage/async-storage": "npm:^1.24.0" - "@react-native-clipboard/clipboard": "npm:^1.15.0" - "@react-navigation/drawer": "npm:^7.1.1" - "@react-navigation/native": "npm:^7.0.14" - "@shopify/flash-list": "patch:@shopify/flash-list@npm%3A1.7.2#~/.yarn/patches/@shopify-flash-list-npm-1.7.2-2a363895ca.patch" "@stylexjs/babel-plugin": "npm:^0.10.0" - "@types/eslint": "npm:^8" common-app: "workspace:*" - eslint: "npm:^8.57.0" - eslint-config-prettier: "npm:^9.1.0" - eslint-import-resolver-typescript: "npm:^3.6.3" - eslint-plugin-import: "npm:^2.31.0" - eslint-plugin-no-relative-import-paths: "patch:eslint-plugin-no-relative-import-paths@npm%3A1.5.5#~/.yarn/patches/eslint-plugin-no-relative-import-paths-npm-1.5.5-8fb4e4bf7a.patch" - eslint-plugin-perfectionist: "npm:^2.1.0" - eslint-plugin-prettier: "npm:^5.2.1" - eslint-plugin-react-hooks: "npm:^5.0.0" - eslint-plugin-simple-import-sort: "npm:^12.1.1" - eslint-plugin-unused-imports: "npm:^4.1.4" expo: "npm:^52.0.4" - madge: "npm:^5.0.1" - prettier: "npm:^3.3.3" - react: "npm:18.3.1" - react-dom: "npm:18.3.1" - react-native: "npm:0.76.5" - react-native-reanimated: "workspace:*" + react-native: "npm:0.77.0-rc.6" react-native-web: "npm:0.19.13" serve: "npm:^14.2.3" - typescript: "npm:~5.3.0" - typescript-eslint: "npm:^8.12.2" languageName: unknown linkType: soft From 792fced161c671d5eb9f57b8bebea10836a8b286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81opaci=C5=84ski?= Date: Wed, 22 Jan 2025 18:44:03 +0100 Subject: [PATCH 03/17] Remove linting and formatting from web-example --- apps/common-app/package.json | 3 +-- apps/web-example/package.json | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/common-app/package.json b/apps/common-app/package.json index ececc21993f4..cd9084db1e61 100644 --- a/apps/common-app/package.json +++ b/apps/common-app/package.json @@ -36,8 +36,7 @@ "react-native-reanimated": "workspace:*", "react-native-safe-area-context": "5.1.0", "react-native-screens": "4.5.0", - "react-native-svg": "15.11.1", - "react-strict-dom": "0.0.27" + "react-native-svg": "15.11.1" }, "devDependencies": { "@babel/core": "^7.25.2", diff --git a/apps/web-example/package.json b/apps/web-example/package.json index 926abecf301a..9d45dff6731d 100644 --- a/apps/web-example/package.json +++ b/apps/web-example/package.json @@ -6,8 +6,6 @@ "scripts": { "start": "expo start --web", "start:noplugin": "DISABLE_BABEL_PLUGIN=1 yarn start", - "lint": "eslint --max-warnings=0 .", - "format": "prettier --write --list-different .", "production": "yarn expo export -p web && yarn serve dist --single", "build": "" }, From 50a174c092ccf9250e3d6df931cc81006b849d08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81opaci=C5=84ski?= Date: Wed, 22 Jan 2025 19:15:02 +0100 Subject: [PATCH 04/17] Fix some issues --- apps/common-app/package.json | 3 ++- apps/web-example/package.json | 1 + yarn.lock | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/common-app/package.json b/apps/common-app/package.json index cd9084db1e61..ececc21993f4 100644 --- a/apps/common-app/package.json +++ b/apps/common-app/package.json @@ -36,7 +36,8 @@ "react-native-reanimated": "workspace:*", "react-native-safe-area-context": "5.1.0", "react-native-screens": "4.5.0", - "react-native-svg": "15.11.1" + "react-native-svg": "15.11.1", + "react-strict-dom": "0.0.27" }, "devDependencies": { "@babel/core": "^7.25.2", diff --git a/apps/web-example/package.json b/apps/web-example/package.json index 9d45dff6731d..f7b5bcbf2900 100644 --- a/apps/web-example/package.json +++ b/apps/web-example/package.json @@ -12,6 +12,7 @@ "dependencies": { "common-app": "workspace:*", "expo": "^52.0.4", + "react-dom": "18.3.1", "react-native": "0.77.0-rc.6", "react-native-web": "0.19.13" }, diff --git a/yarn.lock b/yarn.lock index 14523757c049..911f2d3ac30b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21885,6 +21885,7 @@ __metadata: "@stylexjs/babel-plugin": "npm:^0.10.0" common-app: "workspace:*" expo: "npm:^52.0.4" + react-dom: "npm:18.3.1" react-native: "npm:0.77.0-rc.6" react-native-web: "npm:0.19.13" serve: "npm:^14.2.3" From 14857271b3152b154d46aaf98ef71ca551955949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81opaci=C5=84ski?= Date: Wed, 22 Jan 2025 19:27:24 +0100 Subject: [PATCH 05/17] Remove unnecessary typecheck --- .github/workflows/example-typescript-check-and-lint.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/example-typescript-check-and-lint.yml b/.github/workflows/example-typescript-check-and-lint.yml index 9afd51efc98e..3ef9de14c2ef 100644 --- a/.github/workflows/example-typescript-check-and-lint.yml +++ b/.github/workflows/example-typescript-check-and-lint.yml @@ -1,6 +1,9 @@ name: Example Typescript check and lint env: YARN_ENABLE_HARDENED_MODE: 0 + TYPE_CHECK_DIRECTORIES: >- + apps/common-app + apps/tvos-example on: pull_request: merge_group: @@ -47,12 +50,8 @@ jobs: - name: Check types working-directory: ${{ matrix.working-directory }} - if: ${{ matrix.working-directory != 'apps/web-example' }} + if: ${{ contains(env.TYPE_CHECK_DIRECTORIES, matrix.working-directory) }} run: yarn tsc --noEmit - - name: Check types - working-directory: ${{ matrix.working-directory }} - if: ${{ matrix.working-directory == 'apps/web-example' }} - run: yarn tsc --noEmit --baseUrl ../.. - name: Lint working-directory: ${{ matrix.working-directory }} run: yarn lint From 4208177b5ead94cff2d8b3b567064e3b387f35d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81opaci=C5=84ski?= Date: Wed, 22 Jan 2025 19:31:12 +0100 Subject: [PATCH 06/17] Disable eslint check for apps importing from common-app --- .github/workflows/example-typescript-check-and-lint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/example-typescript-check-and-lint.yml b/.github/workflows/example-typescript-check-and-lint.yml index 3ef9de14c2ef..06324c04f1dc 100644 --- a/.github/workflows/example-typescript-check-and-lint.yml +++ b/.github/workflows/example-typescript-check-and-lint.yml @@ -54,6 +54,7 @@ jobs: run: yarn tsc --noEmit - name: Lint working-directory: ${{ matrix.working-directory }} + if: ${{ contains(env.TYPE_CHECK_DIRECTORIES, matrix.working-directory) }} run: yarn lint - name: Build WebExample working-directory: ${{ matrix.working-directory }} From 971bf3dac3d8a1c500dad90f48ffdb59095c8fb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81opaci=C5=84ski?= Date: Thu, 23 Jan 2025 17:18:43 +0100 Subject: [PATCH 07/17] Restore lint commands --- apps/fabric-example/ios/.ruby-version | 1 + apps/fabric-example/package.json | 6 +++++- apps/web-example/package.json | 2 ++ yarn.lock | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 apps/fabric-example/ios/.ruby-version diff --git a/apps/fabric-example/ios/.ruby-version b/apps/fabric-example/ios/.ruby-version new file mode 100644 index 000000000000..be94e6f53db6 --- /dev/null +++ b/apps/fabric-example/ios/.ruby-version @@ -0,0 +1 @@ +3.2.2 diff --git a/apps/fabric-example/package.json b/apps/fabric-example/package.json index 2f19c95b57d0..40d21e9ddc3a 100644 --- a/apps/fabric-example/package.json +++ b/apps/fabric-example/package.json @@ -6,12 +6,16 @@ "build": "cd ios && bundle install && bundle exec pod update", "android": "react-native run-android", "ios": "react-native run-ios", - "start": "react-native start" + "start": "react-native start", + "lint": "eslint --max-warnings=0 --ignore-pattern 'common-app/' ." }, "dependencies": { "common-app": "workspace:*", "react-native": "0.77.0-rc.6" }, + "devDependencies": { + "eslint": "^8.57.0" + }, "engines": { "node": ">=18" } diff --git a/apps/web-example/package.json b/apps/web-example/package.json index f7b5bcbf2900..4a7cb60ba4f4 100644 --- a/apps/web-example/package.json +++ b/apps/web-example/package.json @@ -7,6 +7,7 @@ "start": "expo start --web", "start:noplugin": "DISABLE_BABEL_PLUGIN=1 yarn start", "production": "yarn expo export -p web && yarn serve dist --single", + "lint": "eslint --max-warnings=0 .", "build": "" }, "dependencies": { @@ -19,6 +20,7 @@ "devDependencies": { "@expo/metro-runtime": "~4.0.0", "@stylexjs/babel-plugin": "^0.10.0", + "eslint": "^8.57.0", "serve": "^14.2.3" } } diff --git a/yarn.lock b/yarn.lock index 911f2d3ac30b..51f8a6f9c191 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12095,6 +12095,7 @@ __metadata: resolution: "fabric-example@workspace:apps/fabric-example" dependencies: common-app: "workspace:*" + eslint: "npm:^8.57.0" react-native: "npm:0.77.0-rc.6" languageName: unknown linkType: soft @@ -21884,6 +21885,7 @@ __metadata: "@expo/metro-runtime": "npm:~4.0.0" "@stylexjs/babel-plugin": "npm:^0.10.0" common-app: "workspace:*" + eslint: "npm:^8.57.0" expo: "npm:^52.0.4" react-dom: "npm:18.3.1" react-native: "npm:0.77.0-rc.6" From 8c47c7624fb8c66a69e50d772564bab686437301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81opaci=C5=84ski?= Date: Thu, 23 Jan 2025 17:55:33 +0100 Subject: [PATCH 08/17] Move common-app dependencies to a shared getter function --- apps/common-app/.eslintignore | 1 + apps/common-app/scripts/dependencies.js | 25 ++++++++++++++++++++++ apps/fabric-example/images.d.ts | 13 ----------- apps/fabric-example/react-native.config.js | 13 ++--------- apps/macos-example/images.d.ts | 13 ----------- apps/web-example/images.d.ts | 13 ----------- apps/web-example/react-native.config.js | 13 ++--------- 7 files changed, 30 insertions(+), 61 deletions(-) create mode 100644 apps/common-app/.eslintignore create mode 100644 apps/common-app/scripts/dependencies.js delete mode 100644 apps/fabric-example/images.d.ts delete mode 100644 apps/macos-example/images.d.ts delete mode 100644 apps/web-example/images.d.ts diff --git a/apps/common-app/.eslintignore b/apps/common-app/.eslintignore new file mode 100644 index 000000000000..b744996d705e --- /dev/null +++ b/apps/common-app/.eslintignore @@ -0,0 +1 @@ +scripts diff --git a/apps/common-app/scripts/dependencies.js b/apps/common-app/scripts/dependencies.js new file mode 100644 index 000000000000..4d018b797972 --- /dev/null +++ b/apps/common-app/scripts/dependencies.js @@ -0,0 +1,25 @@ +const path = require('path'); + +function resolveDependencies(dependencies = {}) { + return Object.fromEntries( + Object.keys(dependencies).map((name) => [ + name, + { root: path.resolve(__dirname, `../../../node_modules/${name}`) }, + ]) + ); +} + +function getDependencies() { + const commonAppDir = path.resolve(__dirname, '../../common-app'); + const commonAppPkg = require(path.resolve(commonAppDir, 'package.json')); + + // Get all common-app dependencies + const dependencies = resolveDependencies(commonAppPkg.dependencies); + const devDependencies = resolveDependencies(commonAppPkg.devDependencies); + + return { ...devDependencies, ...dependencies }; +} + +module.exports = { + getDependencies, +}; diff --git a/apps/fabric-example/images.d.ts b/apps/fabric-example/images.d.ts deleted file mode 100644 index 5f1bcde0e96d..000000000000 --- a/apps/fabric-example/images.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -declare module '*.jpg' { - import type { ImageSourcePropType } from 'react-native'; - - const value: ImageSourcePropType; - export default value; -} - -declare module '*.png' { - import type { ImageSourcePropType } from 'react-native'; - - const value: ImageSourcePropType; - export default value; -} diff --git a/apps/fabric-example/react-native.config.js b/apps/fabric-example/react-native.config.js index f855e38e9017..f189b78fb184 100644 --- a/apps/fabric-example/react-native.config.js +++ b/apps/fabric-example/react-native.config.js @@ -1,18 +1,9 @@ /** * This file is required to properly resolve native dependencies */ -const path = require('path'); +const { getDependencies } = require('../common-app/scripts/dependencies'); -const commonAppDir = path.resolve(__dirname, '../common-app'); -const commonAppPkg = require(path.resolve(commonAppDir, 'package.json')); - -const dependencies = Object.fromEntries([ - // Include all common-app dependencies - ...Object.keys(commonAppPkg.devDependencies || {}), - ...Object.keys(commonAppPkg.dependencies || {}) -].map(name => [name, { - root: path.resolve(__dirname, `../../node_modules/${name}`) -}])); +const dependencies = getDependencies(); module.exports = { dependencies, diff --git a/apps/macos-example/images.d.ts b/apps/macos-example/images.d.ts deleted file mode 100644 index 5f1bcde0e96d..000000000000 --- a/apps/macos-example/images.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -declare module '*.jpg' { - import type { ImageSourcePropType } from 'react-native'; - - const value: ImageSourcePropType; - export default value; -} - -declare module '*.png' { - import type { ImageSourcePropType } from 'react-native'; - - const value: ImageSourcePropType; - export default value; -} diff --git a/apps/web-example/images.d.ts b/apps/web-example/images.d.ts deleted file mode 100644 index 5f1bcde0e96d..000000000000 --- a/apps/web-example/images.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -declare module '*.jpg' { - import type { ImageSourcePropType } from 'react-native'; - - const value: ImageSourcePropType; - export default value; -} - -declare module '*.png' { - import type { ImageSourcePropType } from 'react-native'; - - const value: ImageSourcePropType; - export default value; -} diff --git a/apps/web-example/react-native.config.js b/apps/web-example/react-native.config.js index f855e38e9017..94a7aa4d2094 100644 --- a/apps/web-example/react-native.config.js +++ b/apps/web-example/react-native.config.js @@ -1,18 +1,9 @@ /** * This file is required to properly resolve native dependencies */ -const path = require('path'); +import { getDependencies } from '../common-app/scripts/dependencies'; -const commonAppDir = path.resolve(__dirname, '../common-app'); -const commonAppPkg = require(path.resolve(commonAppDir, 'package.json')); - -const dependencies = Object.fromEntries([ - // Include all common-app dependencies - ...Object.keys(commonAppPkg.devDependencies || {}), - ...Object.keys(commonAppPkg.dependencies || {}) -].map(name => [name, { - root: path.resolve(__dirname, `../../node_modules/${name}`) -}])); +const { dependencies } = getDependencies(); module.exports = { dependencies, From 8e7195812e407e48d642173ed367d1e1ee320ff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81opaci=C5=84ski?= Date: Thu, 23 Jan 2025 18:45:19 +0100 Subject: [PATCH 09/17] Update macos-example to use shared common-app dependencies, add dependency overridding --- apps/common-app/package.json | 2 +- apps/common-app/scripts/dependencies.js | 40 +++++++++++----- apps/common-app/tsconfig.json | 2 +- apps/fabric-example/react-native.config.js | 2 +- apps/fabric-example/tsconfig.json | 3 +- apps/macos-example/macos/Podfile.lock | 25 ++++------ apps/macos-example/package.json | 44 ++---------------- apps/macos-example/react-native.config.js | 11 +++++ yarn.lock | 53 ++-------------------- 9 files changed, 60 insertions(+), 122 deletions(-) create mode 100644 apps/macos-example/react-native.config.js diff --git a/apps/common-app/package.json b/apps/common-app/package.json index ececc21993f4..084129c1e21d 100644 --- a/apps/common-app/package.json +++ b/apps/common-app/package.json @@ -30,7 +30,6 @@ "d3-shape": "^3.2.0", "eslint-plugin-reanimated": "workspace:*", "react": "18.3.1", - "react-native": "0.77.0-rc.6", "react-native-gesture-handler": "2.22.0", "react-native-pager-view": "6.6.1", "react-native-reanimated": "workspace:*", @@ -69,6 +68,7 @@ "madge": "^5.0.1", "patch-package": "^8.0.0", "prettier": "^3.3.3", + "react-native": "0.77.0-rc.6", "react-native-monorepo-tools": "^1.2.1", "react-test-renderer": "18.3.1", "typescript": "~5.3.0", diff --git a/apps/common-app/scripts/dependencies.js b/apps/common-app/scripts/dependencies.js index 4d018b797972..7e412594a510 100644 --- a/apps/common-app/scripts/dependencies.js +++ b/apps/common-app/scripts/dependencies.js @@ -1,23 +1,41 @@ const path = require('path'); -function resolveDependencies(dependencies = {}) { +/** + * @param {Object.} dependencies + * @param {string[]} exclude + */ +function resolveDependencies(dependencies = {}, exclude = []) { return Object.fromEntries( - Object.keys(dependencies).map((name) => [ - name, - { root: path.resolve(__dirname, `../../../node_modules/${name}`) }, - ]) + Object.keys(dependencies) + .filter((name) => !exclude.includes(name)) + .map((name) => [ + name, + { root: path.resolve(__dirname, `../../../node_modules/${name}`) }, + ]) ); } -function getDependencies() { - const commonAppDir = path.resolve(__dirname, '../../common-app'); +/** + * This function will return the dependencies from the common-app package + * that aren't listed in the current app's package.json + * + * @param {string} currentAppDir - the current app directory (e.g. __dirname) + */ +function getDependencies(currentAppDir = '.') { + const commonAppDir = path.resolve(__dirname, '..'); const commonAppPkg = require(path.resolve(commonAppDir, 'package.json')); - // Get all common-app dependencies - const dependencies = resolveDependencies(commonAppPkg.dependencies); - const devDependencies = resolveDependencies(commonAppPkg.devDependencies); + const currentAppPkg = require(path.resolve(currentAppDir, 'package.json')); + const currentAppDeps = [ + ...Object.keys(currentAppPkg.devDependencies), + ...Object.keys(currentAppPkg.dependencies), + ]; - return { ...devDependencies, ...dependencies }; + return { + // Get all common-app dependencies that aren't already in the current app + ...resolveDependencies(commonAppPkg.devDependencies, currentAppDeps), + ...resolveDependencies(commonAppPkg.dependencies, currentAppDeps), + }; } module.exports = { diff --git a/apps/common-app/tsconfig.json b/apps/common-app/tsconfig.json index 97e8e2cbd000..acb0247b3120 100644 --- a/apps/common-app/tsconfig.json +++ b/apps/common-app/tsconfig.json @@ -6,5 +6,5 @@ "@/*": ["src/*"] } }, - "include": ["src", ".eslintrc.js", "index.ts"] + "include": ["src", "index.ts"] } diff --git a/apps/fabric-example/react-native.config.js b/apps/fabric-example/react-native.config.js index f189b78fb184..03bfd634aa40 100644 --- a/apps/fabric-example/react-native.config.js +++ b/apps/fabric-example/react-native.config.js @@ -3,7 +3,7 @@ */ const { getDependencies } = require('../common-app/scripts/dependencies'); -const dependencies = getDependencies(); +const dependencies = getDependencies(__dirname); module.exports = { dependencies, diff --git a/apps/fabric-example/tsconfig.json b/apps/fabric-example/tsconfig.json index 1dc2571aaeb9..f8f4a4917ead 100644 --- a/apps/fabric-example/tsconfig.json +++ b/apps/fabric-example/tsconfig.json @@ -5,6 +5,5 @@ "paths": { "@/*": ["../common-app/src/*"] } - }, - "exclude": ["node_modules", "metro.config.js"] + } } diff --git a/apps/macos-example/macos/Podfile.lock b/apps/macos-example/macos/Podfile.lock index e458b94baddd..9c26b08ad4c9 100644 --- a/apps/macos-example/macos/Podfile.lock +++ b/apps/macos-example/macos/Podfile.lock @@ -1459,8 +1459,6 @@ PODS: - React-Core - RNCClipboard (1.16.1): - React-Core - - RNCPicker (2.10.2): - - React-Core - RNGestureHandler (2.22.0): - DoubleConversion - glog @@ -1633,7 +1631,7 @@ DEPENDENCIES: - React-logger (from `../node_modules/react-native-macos/ReactCommon/logger`) - React-Mapbuffer (from `../node_modules/react-native-macos/ReactCommon`) - React-microtasksnativemodule (from `../node_modules/react-native-macos/ReactCommon/react/nativemodule/microtasks`) - - react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`) + - react-native-safe-area-context (from `../../../node_modules/react-native-safe-area-context`) - React-nativeconfig (from `../node_modules/react-native-macos/ReactCommon`) - React-NativeModulesApple (from `../node_modules/react-native-macos/ReactCommon/react/nativemodule/core/platform/ios`) - React-perflogger (from `../node_modules/react-native-macos/ReactCommon/reactperflogger`) @@ -1659,12 +1657,11 @@ DEPENDENCIES: - React-utils (from `../node_modules/react-native-macos/ReactCommon/react/utils`) - ReactCodegen (from `build/generated/ios`) - ReactCommon/turbomodule/core (from `../node_modules/react-native-macos/ReactCommon`) - - "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)" - - "RNCClipboard (from `../node_modules/@react-native-clipboard/clipboard`)" - - "RNCPicker (from `../node_modules/@react-native-picker/picker`)" - - RNGestureHandler (from `../node_modules/react-native-gesture-handler`) + - "RNCAsyncStorage (from `../../../node_modules/@react-native-async-storage/async-storage`)" + - "RNCClipboard (from `../../../node_modules/@react-native-clipboard/clipboard`)" + - RNGestureHandler (from `../../../node_modules/react-native-gesture-handler`) - RNReanimated (from `../node_modules/react-native-reanimated`) - - RNSVG (from `../node_modules/react-native-svg`) + - RNSVG (from `../../../node_modules/react-native-svg`) - SocketRocket (from `../node_modules/react-native-macos/third-party-podspecs/SocketRocket.podspec`) - Yoga (from `../node_modules/react-native-macos/ReactCommon/yoga`) @@ -1738,7 +1735,7 @@ EXTERNAL SOURCES: React-microtasksnativemodule: :path: "../node_modules/react-native-macos/ReactCommon/react/nativemodule/microtasks" react-native-safe-area-context: - :path: "../node_modules/react-native-safe-area-context" + :path: "../../../node_modules/react-native-safe-area-context" React-nativeconfig: :path: "../node_modules/react-native-macos/ReactCommon" React-NativeModulesApple: @@ -1790,17 +1787,15 @@ EXTERNAL SOURCES: ReactCommon: :path: "../node_modules/react-native-macos/ReactCommon" RNCAsyncStorage: - :path: "../node_modules/@react-native-async-storage/async-storage" + :path: "../../../node_modules/@react-native-async-storage/async-storage" RNCClipboard: - :path: "../node_modules/@react-native-clipboard/clipboard" - RNCPicker: - :path: "../node_modules/@react-native-picker/picker" + :path: "../../../node_modules/@react-native-clipboard/clipboard" RNGestureHandler: - :path: "../node_modules/react-native-gesture-handler" + :path: "../../../node_modules/react-native-gesture-handler" RNReanimated: :path: "../node_modules/react-native-reanimated" RNSVG: - :path: "../node_modules/react-native-svg" + :path: "../../../node_modules/react-native-svg" SocketRocket: :podspec: "../node_modules/react-native-macos/third-party-podspecs/SocketRocket.podspec" Yoga: diff --git a/apps/macos-example/package.json b/apps/macos-example/package.json index f072217dd416..6f808793e883 100644 --- a/apps/macos-example/package.json +++ b/apps/macos-example/package.json @@ -7,33 +7,14 @@ "build": "cd macos && bundle install && bundle exec pod update", "lint": "eslint . --max-warnings 0", "format": "prettier --write --list-different .", - "start": "react-native start", - "test": "jest" + "start": "react-native start" }, "dependencies": { - "@fortawesome/free-solid-svg-icons": "^6.5.2", - "@fortawesome/react-native-fontawesome": "^0.3.2", - "@gorhom/portal": "^1.0.14", - "@react-native-async-storage/async-storage": "2.1.0", - "@react-native-clipboard/clipboard": "^1.15.0", - "@react-native-community/slider": "4.5.5", - "@react-native-masked-view/masked-view": "0.3.2", - "@react-native-picker/picker": "^2.9.0", - "@react-navigation/drawer": "^7.1.1", - "@react-navigation/native": "^7.0.14", - "@react-navigation/native-stack": "^7.0.0", - "@react-navigation/stack": "^7.1.1", - "@shopify/flash-list": "patch:@shopify/flash-list@npm%3A1.7.2#~/.yarn/patches/@shopify-flash-list-npm-1.7.2-2a363895ca.patch", "common-app": "workspace:*", "react": "18.3.1", "react-native": "0.75.4", - "react-native-gesture-handler": "2.22.0", "react-native-macos": "^0.75.13", - "react-native-pager-view": "6.6.1", - "react-native-reanimated": "workspace:*", - "react-native-safe-area-context": "5.1.0", - "react-native-screens": "4.5.0", - "react-native-svg": "15.11.1" + "react-native-reanimated": "workspace:*" }, "devDependencies": { "@babel/core": "^7.20.0", @@ -42,26 +23,7 @@ "@react-native/babel-preset": "0.75.4", "@react-native/eslint-config": "0.75.4", "@react-native/metro-config": "0.75.4", - "@react-native/typescript-config": "0.75.4", - "@types/react": "^18.2.6", - "@types/react-test-renderer": "^18.0.0", - "babel-jest": "^29.6.3", - "eslint": "^8.57.0", - "eslint-config-prettier": "^9.1.0", - "eslint-import-resolver-typescript": "^3.6.3", - "eslint-plugin-import": "^2.31.0", - "eslint-plugin-no-relative-import-paths": "patch:eslint-plugin-no-relative-import-paths@npm%3A1.5.5#~/.yarn/patches/eslint-plugin-no-relative-import-paths-npm-1.5.5-8fb4e4bf7a.patch", - "eslint-plugin-perfectionist": "^2.1.0", - "eslint-plugin-prettier": "^5.2.1", - "eslint-plugin-react-hooks": "^5.0.0", - "eslint-plugin-simple-import-sort": "^12.1.1", - "eslint-plugin-unused-imports": "^4.1.4", - "jest": "^29.6.3", - "madge": "^5.0.1", - "prettier": "^3.3.3", - "react-test-renderer": "18.2.0", - "typescript": "~5.3.0", - "typescript-eslint": "^8.12.2" + "@react-native/typescript-config": "0.75.4" }, "engines": { "node": ">=18" diff --git a/apps/macos-example/react-native.config.js b/apps/macos-example/react-native.config.js new file mode 100644 index 000000000000..03bfd634aa40 --- /dev/null +++ b/apps/macos-example/react-native.config.js @@ -0,0 +1,11 @@ +/** + * This file is required to properly resolve native dependencies + */ +const { getDependencies } = require('../common-app/scripts/dependencies'); + +const dependencies = getDependencies(__dirname); + +module.exports = { + dependencies, + assets: ['./assets/fonts/'], +}; diff --git a/yarn.lock b/yarn.lock index 51f8a6f9c191..2318c53e5bd5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -157,8 +157,8 @@ __metadata: linkType: hard "@babel/eslint-parser@npm:^7.20.0": - version: 7.25.9 - resolution: "@babel/eslint-parser@npm:7.25.9" + version: 7.26.5 + resolution: "@babel/eslint-parser@npm:7.26.5" dependencies: "@nicolo-ribaudo/eslint-scope-5-internals": "npm:5.1.1-v1" eslint-visitor-keys: "npm:^2.1.0" @@ -166,7 +166,7 @@ __metadata: peerDependencies: "@babel/core": ^7.11.0 eslint: ^7.5.0 || ^8.0.0 || ^9.0.0 - checksum: 10/ebb68d80b1fa2b964ad1147cc610e0c69b224e620419a885ba5abc996740523bee636a0d447fc29a0d495dbce5fa0246737b25e9e679cca6c5797fdac5176378 + checksum: 10/b9e4141f2aa01ea8e54233987d119402462a6b884f399add3b3f28d539bc4d3b311c6c1b58b196fef232e515fc77495aeff59f4668a19d978bddcffa3e66e7ca languageName: node linkType: hard @@ -5182,16 +5182,6 @@ __metadata: languageName: node linkType: hard -"@react-native-picker/picker@npm:^2.9.0": - version: 2.10.2 - resolution: "@react-native-picker/picker@npm:2.10.2" - peerDependencies: - react: "*" - react-native: "*" - checksum: 10/c6cbbc335ab5e7371866c3fb032a946ffc428440129b28c9dd23f6914cdff37c8e9d224ffd1aa77a99c18beaf21fd154cd60a9940ebcbc958fc6ee5fce4d864c - languageName: node - linkType: hard - "@react-native-tvos/virtualized-lists@npm:0.76.0-0": version: 0.76.0-0 resolution: "@react-native-tvos/virtualized-lists@npm:0.76.0-0" @@ -15491,52 +15481,15 @@ __metadata: "@babel/core": "npm:^7.20.0" "@babel/preset-env": "npm:^7.20.0" "@babel/runtime": "npm:^7.20.0" - "@fortawesome/free-solid-svg-icons": "npm:^6.5.2" - "@fortawesome/react-native-fontawesome": "npm:^0.3.2" - "@gorhom/portal": "npm:^1.0.14" - "@react-native-async-storage/async-storage": "npm:2.1.0" - "@react-native-clipboard/clipboard": "npm:^1.15.0" - "@react-native-community/slider": "npm:4.5.5" - "@react-native-masked-view/masked-view": "npm:0.3.2" - "@react-native-picker/picker": "npm:^2.9.0" "@react-native/babel-preset": "npm:0.75.4" "@react-native/eslint-config": "npm:0.75.4" "@react-native/metro-config": "npm:0.75.4" "@react-native/typescript-config": "npm:0.75.4" - "@react-navigation/drawer": "npm:^7.1.1" - "@react-navigation/native": "npm:^7.0.14" - "@react-navigation/native-stack": "npm:^7.0.0" - "@react-navigation/stack": "npm:^7.1.1" - "@shopify/flash-list": "patch:@shopify/flash-list@npm%3A1.7.2#~/.yarn/patches/@shopify-flash-list-npm-1.7.2-2a363895ca.patch" - "@types/react": "npm:^18.2.6" - "@types/react-test-renderer": "npm:^18.0.0" - babel-jest: "npm:^29.6.3" common-app: "workspace:*" - eslint: "npm:^8.57.0" - eslint-config-prettier: "npm:^9.1.0" - eslint-import-resolver-typescript: "npm:^3.6.3" - eslint-plugin-import: "npm:^2.31.0" - eslint-plugin-no-relative-import-paths: "patch:eslint-plugin-no-relative-import-paths@npm%3A1.5.5#~/.yarn/patches/eslint-plugin-no-relative-import-paths-npm-1.5.5-8fb4e4bf7a.patch" - eslint-plugin-perfectionist: "npm:^2.1.0" - eslint-plugin-prettier: "npm:^5.2.1" - eslint-plugin-react-hooks: "npm:^5.0.0" - eslint-plugin-simple-import-sort: "npm:^12.1.1" - eslint-plugin-unused-imports: "npm:^4.1.4" - jest: "npm:^29.6.3" - madge: "npm:^5.0.1" - prettier: "npm:^3.3.3" react: "npm:18.3.1" react-native: "npm:0.75.4" - react-native-gesture-handler: "npm:2.22.0" react-native-macos: "npm:^0.75.13" - react-native-pager-view: "npm:6.6.1" react-native-reanimated: "workspace:*" - react-native-safe-area-context: "npm:5.1.0" - react-native-screens: "npm:4.5.0" - react-native-svg: "npm:15.11.1" - react-test-renderer: "npm:18.2.0" - typescript: "npm:~5.3.0" - typescript-eslint: "npm:^8.12.2" languageName: unknown linkType: soft From 156f0b220728540afda337cb7b3f58d897ad3f00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81opaci=C5=84ski?= Date: Thu, 23 Jan 2025 18:48:06 +0100 Subject: [PATCH 10/17] Add some files to tsconfig excludes, format files --- apps/common-app/scripts/dependencies.js | 10 +++++----- apps/common-app/tsconfig.json | 2 +- apps/fabric-example/tsconfig.json | 3 ++- apps/macos-example/react-native.config.js | 4 +--- .../android/src/main/cpp/reanimated/CMakeLists.txt | 9 +++------ 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/apps/common-app/scripts/dependencies.js b/apps/common-app/scripts/dependencies.js index 7e412594a510..5bb5d4a8581d 100644 --- a/apps/common-app/scripts/dependencies.js +++ b/apps/common-app/scripts/dependencies.js @@ -1,7 +1,7 @@ const path = require('path'); /** - * @param {Object.} dependencies + * @param {Object} dependencies * @param {string[]} exclude */ function resolveDependencies(dependencies = {}, exclude = []) { @@ -16,10 +16,10 @@ function resolveDependencies(dependencies = {}, exclude = []) { } /** - * This function will return the dependencies from the common-app package - * that aren't listed in the current app's package.json - * - * @param {string} currentAppDir - the current app directory (e.g. __dirname) + * This function will return the dependencies from the common-app package that + * aren't listed in the current app's package.json + * + * @param {string} currentAppDir - The current app directory (e.g. __dirname) */ function getDependencies(currentAppDir = '.') { const commonAppDir = path.resolve(__dirname, '..'); diff --git a/apps/common-app/tsconfig.json b/apps/common-app/tsconfig.json index acb0247b3120..97e8e2cbd000 100644 --- a/apps/common-app/tsconfig.json +++ b/apps/common-app/tsconfig.json @@ -6,5 +6,5 @@ "@/*": ["src/*"] } }, - "include": ["src", "index.ts"] + "include": ["src", ".eslintrc.js", "index.ts"] } diff --git a/apps/fabric-example/tsconfig.json b/apps/fabric-example/tsconfig.json index f8f4a4917ead..d9fdd1dd94f9 100644 --- a/apps/fabric-example/tsconfig.json +++ b/apps/fabric-example/tsconfig.json @@ -5,5 +5,6 @@ "paths": { "@/*": ["../common-app/src/*"] } - } + }, + "exclude": ["metro.config.js"] } diff --git a/apps/macos-example/react-native.config.js b/apps/macos-example/react-native.config.js index 03bfd634aa40..37988ae350bc 100644 --- a/apps/macos-example/react-native.config.js +++ b/apps/macos-example/react-native.config.js @@ -1,6 +1,4 @@ -/** - * This file is required to properly resolve native dependencies - */ +/** This file is required to properly resolve native dependencies */ const { getDependencies } = require('../common-app/scripts/dependencies'); const dependencies = getDependencies(__dirname); diff --git a/packages/react-native-reanimated/android/src/main/cpp/reanimated/CMakeLists.txt b/packages/react-native-reanimated/android/src/main/cpp/reanimated/CMakeLists.txt index 8c6dcca88a47..71da2bf0e7c0 100644 --- a/packages/react-native-reanimated/android/src/main/cpp/reanimated/CMakeLists.txt +++ b/packages/react-native-reanimated/android/src/main/cpp/reanimated/CMakeLists.txt @@ -110,12 +110,9 @@ elseif(${JS_RUNTIME} STREQUAL "jsc") elseif(${JS_RUNTIME} STREQUAL "v8") # TODO: Refactor this when adding support for newest V8 target_include_directories(reanimated PRIVATE "${JS_RUNTIME_DIR}/src") - file( - GLOB - V8_SO_DIR - "${JS_RUNTIME_DIR}/android/build/intermediates/library_jni/**/\ - jni/${ANDROID_ABI}" - ) + file(GLOB V8_SO_DIR + "${JS_RUNTIME_DIR}/android/build/intermediates/library_jni/**/\ + jni/${ANDROID_ABI}") find_library( V8EXECUTOR_LIB v8executor PATHS ${V8_SO_DIR} From a39b8e54056432f23e1e864a062b77b08faec1b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81opaci=C5=84ski?= Date: Thu, 23 Jan 2025 19:02:19 +0100 Subject: [PATCH 11/17] Fix some issues --- apps/fabric-example/metro.config.js | 4 +++- apps/fabric-example/package.json | 4 ++-- apps/fabric-example/react-native.config.js | 4 +--- apps/fabric-example/tsconfig.json | 2 +- apps/macos-example/macos/Podfile.lock | 2 +- apps/macos-example/package.json | 4 ++-- apps/tvos-example/ios/Podfile.lock | 2 +- apps/web-example/package.json | 4 ++-- apps/web-example/react-native.config.js | 4 +--- yarn.lock | 5 +++-- 10 files changed, 17 insertions(+), 18 deletions(-) diff --git a/apps/fabric-example/metro.config.js b/apps/fabric-example/metro.config.js index e6dd2c4efa6d..a2a3cc62f024 100644 --- a/apps/fabric-example/metro.config.js +++ b/apps/fabric-example/metro.config.js @@ -2,7 +2,9 @@ const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config'); const { wrapWithReanimatedMetroConfig, } = require('react-native-reanimated/metro-config'); -const { getMetroAndroidAssetsResolutionFix } = require('react-native-monorepo-tools'); +const { + getMetroAndroidAssetsResolutionFix, +} = require('react-native-monorepo-tools'); const androidAssetsResolutionFix = getMetroAndroidAssetsResolutionFix(); const path = require('path'); diff --git a/apps/fabric-example/package.json b/apps/fabric-example/package.json index 40d21e9ddc3a..a40c99606018 100644 --- a/apps/fabric-example/package.json +++ b/apps/fabric-example/package.json @@ -7,14 +7,14 @@ "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", - "lint": "eslint --max-warnings=0 --ignore-pattern 'common-app/' ." + "format": "prettier --write --list-different ." }, "dependencies": { "common-app": "workspace:*", "react-native": "0.77.0-rc.6" }, "devDependencies": { - "eslint": "^8.57.0" + "prettier": "^3.3.3" }, "engines": { "node": ">=18" diff --git a/apps/fabric-example/react-native.config.js b/apps/fabric-example/react-native.config.js index 03bfd634aa40..37988ae350bc 100644 --- a/apps/fabric-example/react-native.config.js +++ b/apps/fabric-example/react-native.config.js @@ -1,6 +1,4 @@ -/** - * This file is required to properly resolve native dependencies - */ +/** This file is required to properly resolve native dependencies */ const { getDependencies } = require('../common-app/scripts/dependencies'); const dependencies = getDependencies(__dirname); diff --git a/apps/fabric-example/tsconfig.json b/apps/fabric-example/tsconfig.json index d9fdd1dd94f9..a97c6a62d404 100644 --- a/apps/fabric-example/tsconfig.json +++ b/apps/fabric-example/tsconfig.json @@ -6,5 +6,5 @@ "@/*": ["../common-app/src/*"] } }, - "exclude": ["metro.config.js"] + "exclude": ["metro.config.js", "android", "ios", ".bundle", "node_modules"] } diff --git a/apps/macos-example/macos/Podfile.lock b/apps/macos-example/macos/Podfile.lock index 9c26b08ad4c9..26898e4d1fb3 100644 --- a/apps/macos-example/macos/Podfile.lock +++ b/apps/macos-example/macos/Podfile.lock @@ -1869,7 +1869,7 @@ SPEC CHECKSUMS: RNReanimated: 5e21c891ee78aa03ffbd0ce2c8d15a7c263f499f RNSVG: 46769c92d1609e617dbf9326ad8a0cff912d0982 SocketRocket: 9ee265c4b5ae2382d18e4ee1d2dd2d7af0ff1ab5 - Yoga: 446e6f351a519539ff00a1159fe41e589aab1b94 + Yoga: 209f62622a01344dbb9fa8d348610eaeb7df2cca PODFILE CHECKSUM: 8d50cc2acc9f6a6b1a12bd9106b86385ad72266f diff --git a/apps/macos-example/package.json b/apps/macos-example/package.json index 6f808793e883..a88d0e544c7f 100644 --- a/apps/macos-example/package.json +++ b/apps/macos-example/package.json @@ -5,7 +5,6 @@ "scripts": { "macos": "react-native run-macos", "build": "cd macos && bundle install && bundle exec pod update", - "lint": "eslint . --max-warnings 0", "format": "prettier --write --list-different .", "start": "react-native start" }, @@ -23,7 +22,8 @@ "@react-native/babel-preset": "0.75.4", "@react-native/eslint-config": "0.75.4", "@react-native/metro-config": "0.75.4", - "@react-native/typescript-config": "0.75.4" + "@react-native/typescript-config": "0.75.4", + "prettier": "^3.3.3" }, "engines": { "node": ">=18" diff --git a/apps/tvos-example/ios/Podfile.lock b/apps/tvos-example/ios/Podfile.lock index 686d9c943b1b..87ddbe2337e2 100644 --- a/apps/tvos-example/ios/Podfile.lock +++ b/apps/tvos-example/ios/Podfile.lock @@ -1888,7 +1888,7 @@ SPEC CHECKSUMS: ReactCommon: 387c81ac0d7efbc9818b07e05ffae71ee356aa91 RNReanimated: 0ac2a2f20448fd74996312fdd9845816af2f2b95 SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 - Yoga: 651e5fd560c7e408ab9d9ca44b8de1b622d7f0cc + Yoga: 2b0e5affb9ab46e4ebad33530df829c153c323d8 PODFILE CHECKSUM: 79e1477a8eb76b717bdd7c1610f7f8e6772536a9 diff --git a/apps/web-example/package.json b/apps/web-example/package.json index 4a7cb60ba4f4..3be5815549d5 100644 --- a/apps/web-example/package.json +++ b/apps/web-example/package.json @@ -7,7 +7,7 @@ "start": "expo start --web", "start:noplugin": "DISABLE_BABEL_PLUGIN=1 yarn start", "production": "yarn expo export -p web && yarn serve dist --single", - "lint": "eslint --max-warnings=0 .", + "format": "prettier --write --list-different .", "build": "" }, "dependencies": { @@ -20,7 +20,7 @@ "devDependencies": { "@expo/metro-runtime": "~4.0.0", "@stylexjs/babel-plugin": "^0.10.0", - "eslint": "^8.57.0", + "prettier": "^3.3.3", "serve": "^14.2.3" } } diff --git a/apps/web-example/react-native.config.js b/apps/web-example/react-native.config.js index 94a7aa4d2094..79b1c84299c5 100644 --- a/apps/web-example/react-native.config.js +++ b/apps/web-example/react-native.config.js @@ -1,6 +1,4 @@ -/** - * This file is required to properly resolve native dependencies - */ +/** This file is required to properly resolve native dependencies */ import { getDependencies } from '../common-app/scripts/dependencies'; const { dependencies } = getDependencies(); diff --git a/yarn.lock b/yarn.lock index 2318c53e5bd5..cf0ab90fe2a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12085,7 +12085,7 @@ __metadata: resolution: "fabric-example@workspace:apps/fabric-example" dependencies: common-app: "workspace:*" - eslint: "npm:^8.57.0" + prettier: "npm:^3.3.3" react-native: "npm:0.77.0-rc.6" languageName: unknown linkType: soft @@ -15486,6 +15486,7 @@ __metadata: "@react-native/metro-config": "npm:0.75.4" "@react-native/typescript-config": "npm:0.75.4" common-app: "workspace:*" + prettier: "npm:^3.3.3" react: "npm:18.3.1" react-native: "npm:0.75.4" react-native-macos: "npm:^0.75.13" @@ -21838,8 +21839,8 @@ __metadata: "@expo/metro-runtime": "npm:~4.0.0" "@stylexjs/babel-plugin": "npm:^0.10.0" common-app: "workspace:*" - eslint: "npm:^8.57.0" expo: "npm:^52.0.4" + prettier: "npm:^3.3.3" react-dom: "npm:18.3.1" react-native: "npm:0.77.0-rc.6" react-native-web: "npm:0.19.13" From d4cfd18c29da385f1b51701abce20b60b9adac35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81opaci=C5=84ski?= Date: Thu, 23 Jan 2025 19:28:31 +0100 Subject: [PATCH 12/17] Try to fix macos build on CI --- .github/workflows/example-macos-build-check.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/example-macos-build-check.yml b/.github/workflows/example-macos-build-check.yml index c2dc021f8229..177c4e8b84fc 100644 --- a/.github/workflows/example-macos-build-check.yml +++ b/.github/workflows/example-macos-build-check.yml @@ -53,7 +53,9 @@ jobs: - name: Install Pods working-directory: ${{ env.WORKING_DIRECTORY }}/macos - run: bundle install && bundle exec pod update # There's some bug on the macOS runners for pod installation and this is the workaround. + run: | + bundle install + bundle exec pod install - name: Build app working-directory: ${{ env.WORKING_DIRECTORY }} From 32f15a69a1c41e5ace17de371712d9c07f006727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81opaci=C5=84ski?= Date: Fri, 24 Jan 2025 12:57:44 +0100 Subject: [PATCH 13/17] Try with another ruby version --- apps/macos-example/macos/.ruby-version | 1 + apps/macos-example/macos/Podfile.lock | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 apps/macos-example/macos/.ruby-version diff --git a/apps/macos-example/macos/.ruby-version b/apps/macos-example/macos/.ruby-version new file mode 100644 index 000000000000..be94e6f53db6 --- /dev/null +++ b/apps/macos-example/macos/.ruby-version @@ -0,0 +1 @@ +3.2.2 diff --git a/apps/macos-example/macos/Podfile.lock b/apps/macos-example/macos/Podfile.lock index 26898e4d1fb3..9c26b08ad4c9 100644 --- a/apps/macos-example/macos/Podfile.lock +++ b/apps/macos-example/macos/Podfile.lock @@ -1869,7 +1869,7 @@ SPEC CHECKSUMS: RNReanimated: 5e21c891ee78aa03ffbd0ce2c8d15a7c263f499f RNSVG: 46769c92d1609e617dbf9326ad8a0cff912d0982 SocketRocket: 9ee265c4b5ae2382d18e4ee1d2dd2d7af0ff1ab5 - Yoga: 209f62622a01344dbb9fa8d348610eaeb7df2cca + Yoga: 446e6f351a519539ff00a1159fe41e589aab1b94 PODFILE CHECKSUM: 8d50cc2acc9f6a6b1a12bd9106b86385ad72266f From 6b16ff19001e726c2ead9dadafd8381d8631f87a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81opaci=C5=84ski?= Date: Fri, 24 Jan 2025 13:24:45 +0100 Subject: [PATCH 14/17] Try with newer bundler and ruby --- .github/workflows/example-android-build-check.yml | 10 ++++------ .github/workflows/example-ios-build-check.yml | 12 +++++------- apps/fabric-example/ios/.ruby-version | 1 - apps/macos-example/Gemfile | 2 +- apps/macos-example/macos/.ruby-version | 1 - 5 files changed, 10 insertions(+), 16 deletions(-) delete mode 100644 apps/fabric-example/ios/.ruby-version delete mode 100644 apps/macos-example/macos/.ruby-version diff --git a/.github/workflows/example-android-build-check.yml b/.github/workflows/example-android-build-check.yml index e86508467aba..478e34ef972b 100644 --- a/.github/workflows/example-android-build-check.yml +++ b/.github/workflows/example-android-build-check.yml @@ -28,12 +28,10 @@ jobs: build: if: github.repository == 'software-mansion/react-native-reanimated' runs-on: ubuntu-latest - strategy: - matrix: - working-directory: [apps/fabric-example] - fail-fast: false + env: + WORKING_DIRECTORY: apps/fabric-example concurrency: - group: android-${{ matrix.working-directory }}-${{ github.ref }} + group: android-${{ github.ref }} cancel-in-progress: true steps: - name: Check out Git repository @@ -50,5 +48,5 @@ jobs: run: yarn install --immutable - name: Build app - working-directory: ${{ matrix.working-directory }}/android + working-directory: ${{ env.WORKING_DIRECTORY }}/android run: ./gradlew assembleDebug --build-cache -PreactNativeArchitectures=arm64-v8a diff --git a/.github/workflows/example-ios-build-check.yml b/.github/workflows/example-ios-build-check.yml index d23c10d7172f..315181c0b88a 100644 --- a/.github/workflows/example-ios-build-check.yml +++ b/.github/workflows/example-ios-build-check.yml @@ -32,12 +32,10 @@ jobs: build: if: github.repository == 'software-mansion/react-native-reanimated' runs-on: macos-14 - strategy: - matrix: - working-directory: [apps/fabric-example] - fail-fast: false + env: + WORKING_DIRECTORY: apps/fabric-example concurrency: - group: ios-${{ matrix.working-directory }}-${{ github.ref }} + group: ios-${{ github.ref }} cancel-in-progress: true steps: - name: Check out Git repository @@ -51,11 +49,11 @@ jobs: run: yarn install --immutable # TODO: Add caching for node_modules and artifacts that will work with monorepo setup. - name: Install Pods - working-directory: ${{ matrix.working-directory }}/ios + working-directory: ${{ env.WORKING_DIRECTORY }}/ios run: | bundle install bundle exec pod install - name: Build app - working-directory: ${{ matrix.working-directory }} + working-directory: ${{ env.WORKING_DIRECTORY }} run: yarn react-native run-ios --no-packager diff --git a/apps/fabric-example/ios/.ruby-version b/apps/fabric-example/ios/.ruby-version deleted file mode 100644 index be94e6f53db6..000000000000 --- a/apps/fabric-example/ios/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -3.2.2 diff --git a/apps/macos-example/Gemfile b/apps/macos-example/Gemfile index 2a7ce357c5b2..590146eed9ca 100644 --- a/apps/macos-example/Gemfile +++ b/apps/macos-example/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version -ruby ">= 2.6.10" +ruby ">= 3.2.2" # Exclude problematic versions of cocoapods and activesupport that causes build failures. gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1' diff --git a/apps/macos-example/macos/.ruby-version b/apps/macos-example/macos/.ruby-version deleted file mode 100644 index be94e6f53db6..000000000000 --- a/apps/macos-example/macos/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -3.2.2 From 1d37b7741ebdad76444fd7fd1ad9bd9857e49e8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81opaci=C5=84ski?= Date: Fri, 24 Jan 2025 13:32:29 +0100 Subject: [PATCH 15/17] Another attempt --- apps/macos-example/Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/macos-example/Gemfile b/apps/macos-example/Gemfile index 590146eed9ca..2a7ce357c5b2 100644 --- a/apps/macos-example/Gemfile +++ b/apps/macos-example/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version -ruby ">= 3.2.2" +ruby ">= 2.6.10" # Exclude problematic versions of cocoapods and activesupport that causes build failures. gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1' From 561576141831567ceb6d85eeda21353ea259d8c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81opaci=C5=84ski?= Date: Fri, 24 Jan 2025 15:28:21 +0100 Subject: [PATCH 16/17] Fix eslint config, remove .eslintignore for scripts --- ...ve-import-paths-npm-1.5.5-8fb4e4bf7a.patch | 124 ------------------ apps/common-app/.eslintignore | 1 - apps/common-app/.eslintrc.js | 86 ++++++------ apps/common-app/package.json | 2 +- yarn.lock | 17 +-- 5 files changed, 52 insertions(+), 178 deletions(-) delete mode 100644 .yarn/patches/eslint-plugin-no-relative-import-paths-npm-1.5.5-8fb4e4bf7a.patch delete mode 100644 apps/common-app/.eslintignore diff --git a/.yarn/patches/eslint-plugin-no-relative-import-paths-npm-1.5.5-8fb4e4bf7a.patch b/.yarn/patches/eslint-plugin-no-relative-import-paths-npm-1.5.5-8fb4e4bf7a.patch deleted file mode 100644 index fb2fed30da86..000000000000 --- a/.yarn/patches/eslint-plugin-no-relative-import-paths-npm-1.5.5-8fb4e4bf7a.patch +++ /dev/null @@ -1,124 +0,0 @@ -diff --git a/index.js b/index.js -index 709991da99b8b5cd9c5f4d81774d874da087a20c..d4a1fd6b30af87f3e0a3a32bdc249758df7c1355 100644 ---- a/index.js -+++ b/index.js -@@ -46,59 +46,75 @@ module.exports = { - fixable: "code", - schema: { - type: "array", -- minItems: 0, -- maxItems: 1, -- items: [ -- { -- type: "object", -- properties: { -- allowSameFolder: { type: "boolean" }, -- rootDir: { type: "string" }, -- prefix: { type: "string" }, -- allowedDepth: { type: "number" }, -- }, -- additionalProperties: false, -+ items: { -+ type: "object", -+ properties: { -+ allowSameFolder: { type: "boolean" }, -+ rootDir: { type: "string" }, -+ prefix: { type: "string" }, -+ allowedDepth: { type: "number" }, - }, -- ], -+ additionalProperties: false, -+ }, - }, - }, - create: function (context) { -- const { allowedDepth, allowSameFolder, rootDir, prefix } = { -- allowedDepth: context.options[0]?.allowedDepth, -- allowSameFolder: context.options[0]?.allowSameFolder || false, -- rootDir: context.options[0]?.rootDir || '', -- prefix: context.options[0]?.prefix || '', -- }; -+ const configs = context.options.map(config => ({ -+ allowedDepth: config?.allowedDepth, -+ allowSameFolder: config?.allowSameFolder || false, -+ rootDir: config?.rootDir || '', -+ prefix: config?.prefix || '', -+ })); - - return { - ImportDeclaration: function (node) { -- const path = node.source.value; -- if (isParentFolder(path, context, rootDir)) { -- if (typeof allowedDepth === 'undefined' || getRelativePathDepth(path) > allowedDepth) { -- context.report({ -- node, -- message: message, -- fix: function (fixer) { -- return fixer.replaceTextRange( -- [node.source.range[0] + 1, node.source.range[1] - 1], -- getAbsolutePath(path, context, rootDir, prefix) -- ); -- }, -- }); -+ const importPath = node.source.value; -+ -+ for (const config of configs) { -+ const { allowedDepth, allowSameFolder, rootDir, prefix } = config; -+ -+ if (isParentFolder(importPath, context, rootDir)) { -+ if (typeof allowedDepth === 'undefined' || getRelativePathDepth(importPath) > allowedDepth) { -+ const absolutePath = getAbsolutePath(importPath, context, rootDir, prefix); -+ // Only fix if the path is under this rootDir -+ const absoluteFilePath = path.join(path.dirname(context.getFilename()), importPath); -+ const absoluteRootPath = path.join(context.getCwd(), rootDir); -+ -+ if (absoluteFilePath.startsWith(absoluteRootPath)) { -+ context.report({ -+ node, -+ message: message, -+ fix: function (fixer) { -+ return fixer.replaceTextRange( -+ [node.source.range[0] + 1, node.source.range[1] - 1], -+ absolutePath -+ ); -+ }, -+ }); -+ return; // Stop checking other configs once we've found a match -+ } -+ } - } -- } - -- if (isSameFolder(path) && !allowSameFolder) { -- context.report({ -- node, -- message: message, -- fix: function (fixer) { -- return fixer.replaceTextRange( -- [node.source.range[0] + 1, node.source.range[1] - 1], -- getAbsolutePath(path, context, rootDir, prefix) -- ); -- }, -- }); -+ if (isSameFolder(importPath) && !allowSameFolder) { -+ const absolutePath = getAbsolutePath(importPath, context, rootDir, prefix); -+ const absoluteFilePath = path.join(path.dirname(context.getFilename()), importPath); -+ const absoluteRootPath = path.join(context.getCwd(), rootDir); -+ -+ if (absoluteFilePath.startsWith(absoluteRootPath)) { -+ context.report({ -+ node, -+ message: message, -+ fix: function (fixer) { -+ return fixer.replaceTextRange( -+ [node.source.range[0] + 1, node.source.range[1] - 1], -+ absolutePath -+ ); -+ }, -+ }); -+ return; // Stop checking other configs once we've found a match -+ } -+ } - } - }, - }; diff --git a/apps/common-app/.eslintignore b/apps/common-app/.eslintignore deleted file mode 100644 index b744996d705e..000000000000 --- a/apps/common-app/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -scripts diff --git a/apps/common-app/.eslintrc.js b/apps/common-app/.eslintrc.js index 60a53a99f3cf..f06ccca5e17a 100644 --- a/apps/common-app/.eslintrc.js +++ b/apps/common-app/.eslintrc.js @@ -7,16 +7,58 @@ module.exports = { extends: [ 'eslint:recommended', 'plugin:react/recommended', - 'plugin:@typescript-eslint/recommended-requiring-type-checking', 'plugin:import/recommended', 'plugin:import/typescript', 'plugin:perfectionist/recommended-natural', 'prettier', ], - parser: '@typescript-eslint/parser', + overrides: [ + { + extends: [ + 'plugin:@typescript-eslint/recommended-requiring-type-checking', + ], + files: ['*.ts', '*.tsx'], + parser: '@typescript-eslint/parser', + parserOptions: { + project: './tsconfig.json', + tsconfigRootDir: __dirname, + }, + plugins: ['@typescript-eslint'], + rules: { + '@typescript-eslint/array-type': ['error', { default: 'generic' }], + '@typescript-eslint/consistent-type-exports': 'error', + '@typescript-eslint/consistent-type-imports': 'error', + '@typescript-eslint/member-ordering': [ + 'error', + { default: ['signature', 'method', 'constructor', 'field'] }, + ], + '@typescript-eslint/naming-convention': [ + 2, + { + format: ['PascalCase'], + selector: 'enumMember', + }, + ], + '@typescript-eslint/no-floating-promises': [ + 'error', + { + ignoreIIFE: true, + ignoreVoid: true, + }, + ], + '@typescript-eslint/no-shadow': 'error', + '@typescript-eslint/prefer-nullish-coalescing': [ + 'error', + { + ignoreConditionalTests: true, + ignoreMixedLogicalExpressions: true, + }, + ], + }, + }, + ], parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: __dirname, + ecmaVersion: 2021, }, plugins: [ 'react', @@ -27,40 +69,10 @@ module.exports = { 'simple-import-sort', 'no-relative-import-paths', 'perfectionist', - '@typescript-eslint', 'prettier', ], root: true, rules: { - '@typescript-eslint/array-type': ['error', { default: 'generic' }], - '@typescript-eslint/consistent-type-exports': 'error', - '@typescript-eslint/consistent-type-imports': 'error', - '@typescript-eslint/member-ordering': [ - 'error', - { default: ['signature', 'method', 'constructor', 'field'] }, - ], - '@typescript-eslint/naming-convention': [ - 2, - { - format: ['PascalCase'], - selector: 'enumMember', - }, - ], - '@typescript-eslint/no-floating-promises': [ - 'error', - { - ignoreIIFE: true, - ignoreVoid: true, - }, - ], - '@typescript-eslint/no-shadow': 'error', - '@typescript-eslint/prefer-nullish-coalescing': [ - 'error', - { - ignoreConditionalTests: true, - ignoreMixedLogicalExpressions: true, - }, - ], camelcase: [ 'error', { @@ -179,12 +191,6 @@ module.exports = { 'no-regex-spaces': ['error'], 'no-relative-import-paths/no-relative-import-paths': [ 'warn', - { - allowSameFolder: true, - allowedDepth: 1, - prefix: '~', - rootDir: 'src/apps', - }, { allowSameFolder: true, allowedDepth: 1, prefix: '@', rootDir: 'src' }, ], 'no-return-assign': ['error', 'except-parens'], diff --git a/apps/common-app/package.json b/apps/common-app/package.json index 084129c1e21d..884b4b077f05 100644 --- a/apps/common-app/package.json +++ b/apps/common-app/package.json @@ -58,7 +58,7 @@ "eslint-config-prettier": "^9.1.0", "eslint-import-resolver-typescript": "^3.6.3", "eslint-plugin-import": "^2.31.0", - "eslint-plugin-no-relative-import-paths": "patch:eslint-plugin-no-relative-import-paths@npm%3A1.5.5#~/.yarn/patches/eslint-plugin-no-relative-import-paths-npm-1.5.5-8fb4e4bf7a.patch", + "eslint-plugin-no-relative-import-paths": "^1.6.1", "eslint-plugin-perfectionist": "^2.1.0", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-react-hooks": "^5.0.0", diff --git a/yarn.lock b/yarn.lock index cf0ab90fe2a3..6d45f94270d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9349,7 +9349,7 @@ __metadata: eslint-config-prettier: "npm:^9.1.0" eslint-import-resolver-typescript: "npm:^3.6.3" eslint-plugin-import: "npm:^2.31.0" - eslint-plugin-no-relative-import-paths: "patch:eslint-plugin-no-relative-import-paths@npm%3A1.5.5#~/.yarn/patches/eslint-plugin-no-relative-import-paths-npm-1.5.5-8fb4e4bf7a.patch" + eslint-plugin-no-relative-import-paths: "npm:^1.6.1" eslint-plugin-perfectionist: "npm:^2.1.0" eslint-plugin-prettier: "npm:^5.2.1" eslint-plugin-react-hooks: "npm:^5.0.0" @@ -11248,17 +11248,10 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-no-relative-import-paths@npm:1.5.5": - version: 1.5.5 - resolution: "eslint-plugin-no-relative-import-paths@npm:1.5.5" - checksum: 10/9c4ac94a4a6b63748ee8c3e97a240e5681da3e38f154d0cffb864b8667a207cf84c3f0411785e65a3c31edcfaa9cffb1e756b3691354285fd2fc1684bd2266c7 - languageName: node - linkType: hard - -"eslint-plugin-no-relative-import-paths@patch:eslint-plugin-no-relative-import-paths@npm%3A1.5.5#~/.yarn/patches/eslint-plugin-no-relative-import-paths-npm-1.5.5-8fb4e4bf7a.patch": - version: 1.5.5 - resolution: "eslint-plugin-no-relative-import-paths@patch:eslint-plugin-no-relative-import-paths@npm%3A1.5.5#~/.yarn/patches/eslint-plugin-no-relative-import-paths-npm-1.5.5-8fb4e4bf7a.patch::version=1.5.5&hash=17eb79" - checksum: 10/c76734a94546f5e100a4a435d0bdcf8c43d4c6f52f6cf663917bdc4bdbabc37e311e3c0aa3ee45026e3b05a878ca920213b7f04193074f95a517ac5309135e74 +"eslint-plugin-no-relative-import-paths@npm:^1.6.1": + version: 1.6.1 + resolution: "eslint-plugin-no-relative-import-paths@npm:1.6.1" + checksum: 10/b769becc029586c9dec93162000dd074fb3ca688d9af6d1d151f1aadc85cc309dd2272e75667477a33604801d8cb80698dcc3d66bbb74c2220a9af48375d724f languageName: node linkType: hard From 6fddb596a0ef6f98a6a92a91d5196d0581571cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81opaci=C5=84ski?= Date: Fri, 24 Jan 2025 15:54:03 +0100 Subject: [PATCH 17/17] Cleanup --- apps/common-app/scripts/dependencies.js | 19 +++++++++++-------- apps/macos-example/macos/Podfile.lock | 1 - 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/apps/common-app/scripts/dependencies.js b/apps/common-app/scripts/dependencies.js index 5bb5d4a8581d..9c1bcfbc4b90 100644 --- a/apps/common-app/scripts/dependencies.js +++ b/apps/common-app/scripts/dependencies.js @@ -2,12 +2,12 @@ const path = require('path'); /** * @param {Object} dependencies - * @param {string[]} exclude + * @param {Set} exclude */ -function resolveDependencies(dependencies = {}, exclude = []) { +function resolveDependencies(dependencies = {}, exclude) { return Object.fromEntries( Object.keys(dependencies) - .filter((name) => !exclude.includes(name)) + .filter((name) => !exclude.has(name)) .map((name) => [ name, { root: path.resolve(__dirname, `../../../node_modules/${name}`) }, @@ -20,21 +20,24 @@ function resolveDependencies(dependencies = {}, exclude = []) { * aren't listed in the current app's package.json * * @param {string} currentAppDir - The current app directory (e.g. __dirname) + * @param {string[]} exclude - The dependencies to exclude from the common-app */ -function getDependencies(currentAppDir = '.') { +function getDependencies(currentAppDir = '.', exclude = []) { const commonAppDir = path.resolve(__dirname, '..'); const commonAppPkg = require(path.resolve(commonAppDir, 'package.json')); const currentAppPkg = require(path.resolve(currentAppDir, 'package.json')); - const currentAppDeps = [ + + const excludedDependencies = new Set([ ...Object.keys(currentAppPkg.devDependencies), ...Object.keys(currentAppPkg.dependencies), - ]; + ...exclude, + ]); return { // Get all common-app dependencies that aren't already in the current app - ...resolveDependencies(commonAppPkg.devDependencies, currentAppDeps), - ...resolveDependencies(commonAppPkg.dependencies, currentAppDeps), + ...resolveDependencies(commonAppPkg.devDependencies, excludedDependencies), + ...resolveDependencies(commonAppPkg.dependencies, excludedDependencies), }; } diff --git a/apps/macos-example/macos/Podfile.lock b/apps/macos-example/macos/Podfile.lock index 9c26b08ad4c9..ec39e5c89ac3 100644 --- a/apps/macos-example/macos/Podfile.lock +++ b/apps/macos-example/macos/Podfile.lock @@ -1864,7 +1864,6 @@ SPEC CHECKSUMS: ReactCommon: 33aa3e538f80f05a4d91150f7d704f1accf9b2ec RNCAsyncStorage: c91d753ede6dc21862c4922cd13f98f7cfde578e RNCClipboard: ee059e6006b137e369caed5eb852b4aad9f5d886 - RNCPicker: d8662eb6615e3401acb590c44b97b2af3beb1e53 RNGestureHandler: 8c8722468ee6ced80a0723943c894798d2613a81 RNReanimated: 5e21c891ee78aa03ffbd0ce2c8d15a7c263f499f RNSVG: 46769c92d1609e617dbf9326ad8a0cff912d0982