From 9c5fbb7bc0bcb9f42ab6226c3205faf4c348ffd6 Mon Sep 17 00:00:00 2001 From: Ahmed Mahmoud <68241710+a7medev@users.noreply.github.com> Date: Thu, 5 Oct 2023 11:15:31 +0300 Subject: [PATCH 1/3] chore: extend default metro config (#1039) --- examples/default/metro.config.js | 5 +- examples/default/package.json | 1 + examples/default/yarn.lock | 390 +++++++++++++++++++++++++++++++ 3 files changed, 395 insertions(+), 1 deletion(-) diff --git a/examples/default/metro.config.js b/examples/default/metro.config.js index 7b7bf874d..2d44f6fe7 100644 --- a/examples/default/metro.config.js +++ b/examples/default/metro.config.js @@ -1,5 +1,6 @@ const path = require('path'); const escape = require('escape-string-regexp'); +const { mergeConfig, getDefaultConfig } = require('@react-native/metro-config'); const exclusionList = require('metro-config/src/defaults/exclusionList'); const root = path.resolve(__dirname, '../..'); @@ -15,7 +16,7 @@ const modules = [ 'promise', ]; -module.exports = { +const config = { watchFolders: [root], transformer: { getTransformOptions: async () => ({ @@ -35,3 +36,5 @@ module.exports = { }, {}), }, }; + +module.exports = mergeConfig(getDefaultConfig(__dirname), config); diff --git a/examples/default/package.json b/examples/default/package.json index 71f38e0d2..26592d3f7 100644 --- a/examples/default/package.json +++ b/examples/default/package.json @@ -25,6 +25,7 @@ "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", + "@react-native/metro-config": "^0.73.1", "@types/jest": "^29.2.1", "@types/react": "^18.0.24", "@types/react-native-vector-icons": "^6.4.13", diff --git a/examples/default/yarn.lock b/examples/default/yarn.lock index aa0b6ae54..9a695546a 100644 --- a/examples/default/yarn.lock +++ b/examples/default/yarn.lock @@ -93,6 +93,21 @@ "@babel/helper-split-export-declaration" "^7.22.6" semver "^6.3.1" +"@babel/helper-create-class-features-plugin@^7.22.11": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.15.tgz#97a61b385e57fe458496fad19f8e63b63c867de4" + integrity sha512-jKkwA59IXcvSaiK2UN45kKwSC9o+KuoXsBDvHvU/7BecYIp8GQ2UwrVvFgJASUT+hBnwJx6MhvMCuMzwZZ7jlg== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-function-name" "^7.22.5" + "@babel/helper-member-expression-to-functions" "^7.22.15" + "@babel/helper-optimise-call-expression" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + semver "^6.3.1" + "@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.22.5": version "7.22.9" resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.9.tgz#9d8e61a8d9366fe66198f57c40565663de0825f6" @@ -133,6 +148,13 @@ dependencies: "@babel/types" "^7.22.5" +"@babel/helper-member-expression-to-functions@^7.22.15": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.23.0.tgz#9263e88cc5e41d39ec18c9a3e0eced59a3e7d366" + integrity sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA== + dependencies: + "@babel/types" "^7.23.0" + "@babel/helper-member-expression-to-functions@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.22.5.tgz#0a7c56117cad3372fbf8d2fb4bf8f8d64a1e76b2" @@ -214,6 +236,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== +"@babel/helper-validator-identifier@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" + integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== + "@babel/helper-validator-identifier@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193" @@ -814,6 +841,16 @@ "@babel/helper-create-class-features-plugin" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-private-property-in-object@^7.22.11": + version "7.22.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.22.11.tgz#ad45c4fc440e9cb84c718ed0906d96cf40f9a4e1" + integrity sha512-sSCbqZDBKHetvjSwpyWzhuHkmW5RummxJBVbYLkGkaiTOWGxml7SXt0iWa03bzxFIx7wOj3g/ILRd0RcJKBeSQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-create-class-features-plugin" "^7.22.11" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/plugin-transform-private-property-in-object@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.22.5.tgz#07a77f28cbb251546a43d175a1dda4cf3ef83e32" @@ -1141,6 +1178,15 @@ "@babel/helper-validator-identifier" "^7.22.5" to-fast-properties "^2.0.0" +"@babel/types@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.0.tgz#8c1f020c9df0e737e4e247c0619f58c68458aaeb" + integrity sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg== + dependencies: + "@babel/helper-string-parser" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.20" + to-fast-properties "^2.0.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -1379,6 +1425,13 @@ dependencies: "@sinclair/typebox" "^0.27.8" +"@jest/schemas@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.6.3.tgz#430b5ce8a4e0044a7e3819663305a7b3091c8e03" + integrity sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA== + dependencies: + "@sinclair/typebox" "^0.27.8" + "@jest/source-map@^29.6.0": version "29.6.0" resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.6.0.tgz#bd34a05b5737cb1a99d43e1957020ac8e5b9ddb1" @@ -1463,6 +1516,18 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" +"@jest/types@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.6.3.tgz#1131f8cf634e7e84c5e77bab12f052af585fba59" + integrity sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw== + dependencies: + "@jest/schemas" "^29.6.3" + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^17.0.8" + chalk "^4.0.0" + "@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": version "0.3.3" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" @@ -2066,6 +2131,71 @@ resolved "https://registry.yarnpkg.com/@react-native/assets-registry/-/assets-registry-0.72.0.tgz#c82a76a1d86ec0c3907be76f7faf97a32bbed05d" integrity sha512-Im93xRJuHHxb1wniGhBMsxLwcfzdYreSZVQGDoMJgkd6+Iky61LInGEHnQCTN0fKNYF1Dvcofb4uMmE1RQHXHQ== +"@react-native/babel-plugin-codegen@*": + version "0.73.1" + resolved "https://registry.yarnpkg.com/@react-native/babel-plugin-codegen/-/babel-plugin-codegen-0.73.1.tgz#c2a4c661d92fa1e392fcda29a8e4420581570010" + integrity sha512-wHUpZ/Gtw9iwKSNsu6rXuXkDtG8mo+/8WcUfocFYXwazLq98QBxXRiJi44gVAS685AusfOPz0p+eNYn68IWN7g== + dependencies: + "@react-native/codegen" "*" + +"@react-native/babel-preset@*": + version "0.73.18" + resolved "https://registry.yarnpkg.com/@react-native/babel-preset/-/babel-preset-0.73.18.tgz#0ff24ba35102d9ac071de8ab10706ccaee5e3e6f" + integrity sha512-FzPasmazoX9WZnmwotk6SK9ydiExdqS4Xt5VaukPoY9u8u3AUUODzqjTsWSOxjFD9eRF3Knyg5H8JMDe6pj5wQ== + dependencies: + "@babel/core" "^7.20.0" + "@babel/plugin-proposal-async-generator-functions" "^7.0.0" + "@babel/plugin-proposal-class-properties" "^7.18.0" + "@babel/plugin-proposal-export-default-from" "^7.0.0" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.18.0" + "@babel/plugin-proposal-numeric-separator" "^7.0.0" + "@babel/plugin-proposal-object-rest-spread" "^7.20.0" + "@babel/plugin-proposal-optional-catch-binding" "^7.0.0" + "@babel/plugin-proposal-optional-chaining" "^7.20.0" + "@babel/plugin-syntax-dynamic-import" "^7.8.0" + "@babel/plugin-syntax-export-default-from" "^7.0.0" + "@babel/plugin-syntax-flow" "^7.18.0" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.0.0" + "@babel/plugin-syntax-optional-chaining" "^7.0.0" + "@babel/plugin-transform-arrow-functions" "^7.0.0" + "@babel/plugin-transform-async-to-generator" "^7.20.0" + "@babel/plugin-transform-block-scoping" "^7.0.0" + "@babel/plugin-transform-classes" "^7.0.0" + "@babel/plugin-transform-computed-properties" "^7.0.0" + "@babel/plugin-transform-destructuring" "^7.20.0" + "@babel/plugin-transform-flow-strip-types" "^7.20.0" + "@babel/plugin-transform-function-name" "^7.0.0" + "@babel/plugin-transform-literals" "^7.0.0" + "@babel/plugin-transform-modules-commonjs" "^7.0.0" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.0.0" + "@babel/plugin-transform-parameters" "^7.0.0" + "@babel/plugin-transform-private-methods" "^7.22.5" + "@babel/plugin-transform-private-property-in-object" "^7.22.11" + "@babel/plugin-transform-react-display-name" "^7.0.0" + "@babel/plugin-transform-react-jsx" "^7.0.0" + "@babel/plugin-transform-react-jsx-self" "^7.0.0" + "@babel/plugin-transform-react-jsx-source" "^7.0.0" + "@babel/plugin-transform-runtime" "^7.0.0" + "@babel/plugin-transform-shorthand-properties" "^7.0.0" + "@babel/plugin-transform-spread" "^7.0.0" + "@babel/plugin-transform-sticky-regex" "^7.0.0" + "@babel/plugin-transform-typescript" "^7.5.0" + "@babel/plugin-transform-unicode-regex" "^7.0.0" + "@babel/template" "^7.0.0" + "@react-native/babel-plugin-codegen" "*" + babel-plugin-transform-flow-enums "^0.0.2" + react-refresh "^0.14.0" + +"@react-native/codegen@*": + version "0.73.1" + resolved "https://registry.yarnpkg.com/@react-native/codegen/-/codegen-0.73.1.tgz#b081a8b8e4d766e7313fdaaaa7c3f79145dac448" + integrity sha512-umgmDWOlfo8y7Ol1dssi5Ade5kR0vGFg4z3A4lC2c1WO7ZU/O446FPLBud+7MV9frqmk64ddnbzrR+U9GN+HoQ== + dependencies: + "@babel/parser" "^7.20.0" + flow-parser "^0.206.0" + jscodeshift "^0.14.0" + nullthrows "^1.1.1" + "@react-native/codegen@^0.72.6": version "0.72.6" resolved "https://registry.yarnpkg.com/@react-native/codegen/-/codegen-0.72.6.tgz#029cf61f82f5c6872f0b2ce58f27c4239a5586c8" @@ -2086,6 +2216,32 @@ resolved "https://registry.yarnpkg.com/@react-native/js-polyfills/-/js-polyfills-0.72.1.tgz#905343ef0c51256f128256330fccbdb35b922291" integrity sha512-cRPZh2rBswFnGt5X5EUEPs0r+pAsXxYsifv/fgy9ZLQokuT52bPH+9xjDR+7TafRua5CttGW83wP4TntRcWNDA== +"@react-native/js-polyfills@^0.73.1": + version "0.73.1" + resolved "https://registry.yarnpkg.com/@react-native/js-polyfills/-/js-polyfills-0.73.1.tgz#730b0a7aaab947ae6f8e5aa9d995e788977191ed" + integrity sha512-ewMwGcumrilnF87H4jjrnvGZEaPFCAC4ebraEK+CurDDmwST/bIicI4hrOAv+0Z0F7DEK4O4H7r8q9vH7IbN4g== + +"@react-native/metro-babel-transformer@^0.73.12": + version "0.73.12" + resolved "https://registry.yarnpkg.com/@react-native/metro-babel-transformer/-/metro-babel-transformer-0.73.12.tgz#6b9c391285a4e376ea4c7bc42667bed015fdeb7c" + integrity sha512-VmxN5aaoOprzDzUR+8c3XYhG0FoMOO6n0ToylCW6EeZCuf5RTY7HWVOhacabGoB1mHrWzJ0wWEsqX+eD4iFxoA== + dependencies: + "@babel/core" "^7.20.0" + "@react-native/babel-preset" "*" + babel-preset-fbjs "^3.4.0" + hermes-parser "0.15.0" + nullthrows "^1.1.1" + +"@react-native/metro-config@^0.73.1": + version "0.73.1" + resolved "https://registry.yarnpkg.com/@react-native/metro-config/-/metro-config-0.73.1.tgz#653da799d126d667bdc4499d1ca17acc011523e7" + integrity sha512-bnRcJ2a50XpQ3ZOrNuroGVDQleak6n/JhSxHrNHsiW4gKirVqxGJAryv+7uQg2zeYfGXgMl6ai5dk+gbUz+yxQ== + dependencies: + "@react-native/js-polyfills" "^0.73.1" + "@react-native/metro-babel-transformer" "^0.73.12" + metro-config "0.79.1" + metro-runtime "0.79.1" + "@react-native/normalize-colors@*": version "0.73.0" resolved "https://registry.yarnpkg.com/@react-native/normalize-colors/-/normalize-colors-0.73.0.tgz#23e15cf2a2b73ac7e5e6df8d5b86b173cfb35a3f" @@ -4007,6 +4163,11 @@ hermes-estree@0.12.0: resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.12.0.tgz#8a289f9aee854854422345e6995a48613bac2ca8" integrity sha512-+e8xR6SCen0wyAKrMT3UD0ZCCLymKhRgjEB5sS28rKiFir/fXgLoeRilRUssFCILmGHb+OvHDUlhxs0+IEyvQw== +hermes-estree@0.15.0: + version "0.15.0" + resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.15.0.tgz#e32f6210ab18c7b705bdcb375f7700f2db15d6ba" + integrity sha512-lLYvAd+6BnOqWdnNbP/Q8xfl8LOGw4wVjfrNd9Gt8eoFzhNBRVD95n4l2ksfMVOoxuVyegs85g83KS9QOsxbVQ== + hermes-parser@0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.12.0.tgz#114dc26697cfb41a6302c215b859b74224383773" @@ -4014,6 +4175,13 @@ hermes-parser@0.12.0: dependencies: hermes-estree "0.12.0" +hermes-parser@0.15.0: + version "0.15.0" + resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.15.0.tgz#f611a297c2a2dbbfbce8af8543242254f604c382" + integrity sha512-Q1uks5rjZlE9RjMMjSUCkGrEIPI5pKJILeCtK1VmTj7U4pf3wVPoo+cxfu+s4cBAPy2JzikIIdCZgBoR6x7U1Q== + dependencies: + hermes-estree "0.15.0" + hermes-profile-transformer@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/hermes-profile-transformer/-/hermes-profile-transformer-0.0.6.tgz#bd0f5ecceda80dd0ddaae443469ab26fb38fc27b" @@ -4388,6 +4556,11 @@ jest-get-type@^29.4.3: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.4.3.tgz#1ab7a5207c995161100b5187159ca82dd48b3dd5" integrity sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg== +jest-get-type@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.6.3.tgz#36f499fdcea197c1045a127319c0481723908fd1" + integrity sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw== + jest-haste-map@^29.6.2: version "29.6.2" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.6.2.tgz#298c25ea5255cfad8b723179d4295cf3a50a70d1" @@ -4604,6 +4777,18 @@ jest-validate@^29.2.1, jest-validate@^29.6.2: leven "^3.1.0" pretty-format "^29.6.2" +jest-validate@^29.6.3: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.7.0.tgz#7bf705511c64da591d46b15fce41400d52147d9c" + integrity sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw== + dependencies: + "@jest/types" "^29.6.3" + camelcase "^6.2.0" + chalk "^4.0.0" + jest-get-type "^29.6.3" + leven "^3.1.0" + pretty-format "^29.7.0" + jest-watcher@^29.6.2: version "29.6.2" resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.6.2.tgz#77c224674f0620d9f6643c4cfca186d8893ca088" @@ -4988,11 +5173,25 @@ metro-babel-transformer@0.76.7: hermes-parser "0.12.0" nullthrows "^1.1.1" +metro-babel-transformer@0.79.1: + version "0.79.1" + resolved "https://registry.yarnpkg.com/metro-babel-transformer/-/metro-babel-transformer-0.79.1.tgz#bb2392227d3db49ffc39b98d8aebe5f7cef46302" + integrity sha512-WvE/At9r0LoNoxGgGhULV4H5ieuLs8AHfVUtTpHaOpgE326BwHNiUYaWuCpaM/BTTlajQltK/U1t+MqbbvFG9A== + dependencies: + "@babel/core" "^7.20.0" + hermes-parser "0.15.0" + nullthrows "^1.1.1" + metro-cache-key@0.76.7: version "0.76.7" resolved "https://registry.yarnpkg.com/metro-cache-key/-/metro-cache-key-0.76.7.tgz#70913f43b92b313096673c37532edd07438cb325" integrity sha512-0pecoIzwsD/Whn/Qfa+SDMX2YyasV0ndbcgUFx7w1Ct2sLHClujdhQ4ik6mvQmsaOcnGkIyN0zcceMDjC2+BFQ== +metro-cache-key@0.79.1: + version "0.79.1" + resolved "https://registry.yarnpkg.com/metro-cache-key/-/metro-cache-key-0.79.1.tgz#80e6f2cd45a3ae04abb6874c75684e91f8c3668e" + integrity sha512-/u48AuINgakqYEymRrD6MzKCSYU/JEXrqGX4x6gVHVa99TKPeg5SBi3MIjpZz/tWGpcQHCKItfjLD48YhEJr3Q== + metro-cache@0.76.7: version "0.76.7" resolved "https://registry.yarnpkg.com/metro-cache/-/metro-cache-0.76.7.tgz#e49e51423fa960df4eeff9760d131f03e003a9eb" @@ -5001,6 +5200,14 @@ metro-cache@0.76.7: metro-core "0.76.7" rimraf "^3.0.2" +metro-cache@0.79.1: + version "0.79.1" + resolved "https://registry.yarnpkg.com/metro-cache/-/metro-cache-0.79.1.tgz#197286fb0d3ee6827d91893b50237070c063c157" + integrity sha512-uRlo1cYewW9t6KuRED0G/iCnlqPc5Hq+I2VELBiJr4lBYwCz8P1KwcdzgSUpAzcZBcarq6rI9JqVPvV4t6P3YQ== + dependencies: + metro-core "0.79.1" + rimraf "^3.0.2" + metro-config@0.76.7: version "0.76.7" resolved "https://registry.yarnpkg.com/metro-config/-/metro-config-0.76.7.tgz#f0fc171707523aa7d3a9311550872136880558c0" @@ -5014,6 +5221,19 @@ metro-config@0.76.7: metro-core "0.76.7" metro-runtime "0.76.7" +metro-config@0.79.1: + version "0.79.1" + resolved "https://registry.yarnpkg.com/metro-config/-/metro-config-0.79.1.tgz#34609c582202bc7a2b6712c77352758ffe6a6eed" + integrity sha512-gleXbytiPTsO88DDUuaprKQLfaOVfoj6L7yw1u6MRXmQdebK3TmWUajqnLdWDQ/D0+JBWfrkFhLjnWXHsA8Cgw== + dependencies: + connect "^3.6.5" + cosmiconfig "^5.0.5" + jest-validate "^29.6.3" + metro "0.79.1" + metro-cache "0.79.1" + metro-core "0.79.1" + metro-runtime "0.79.1" + metro-core@0.76.7: version "0.76.7" resolved "https://registry.yarnpkg.com/metro-core/-/metro-core-0.76.7.tgz#5d2b8bac2cde801dc22666ad7be1336d1f021b61" @@ -5022,6 +5242,14 @@ metro-core@0.76.7: lodash.throttle "^4.1.1" metro-resolver "0.76.7" +metro-core@0.79.1: + version "0.79.1" + resolved "https://registry.yarnpkg.com/metro-core/-/metro-core-0.79.1.tgz#1beed31d6358291d95e42ddb048ed41674f7dea9" + integrity sha512-tPlpLLOKT5D5HSFQBrvgU2gupecCA0YcnQQVOByuLjY5JMXUBU7HISHv5gpbJTUt9KlPQ8OhZV/x6ivyXaVSQg== + dependencies: + lodash.throttle "^4.1.1" + metro-resolver "0.79.1" + metro-file-map@0.76.7: version "0.76.7" resolved "https://registry.yarnpkg.com/metro-file-map/-/metro-file-map-0.76.7.tgz#0f041a4f186ac672f0188180310609c8483ffe89" @@ -5042,6 +5270,25 @@ metro-file-map@0.76.7: optionalDependencies: fsevents "^2.3.2" +metro-file-map@0.79.1: + version "0.79.1" + resolved "https://registry.yarnpkg.com/metro-file-map/-/metro-file-map-0.79.1.tgz#c8aa95d1eac0e3fd7a2e54e4d55c6b9a300cfd95" + integrity sha512-PpPhfkj1Bj448f+5vZaaImJWFSsf6XveYGdRsfwvskcYlMsFBl4OX1WyGTJCCCzrtIOH5y1V3OADI/HS563sCA== + dependencies: + anymatch "^3.0.3" + debug "^2.2.0" + fb-watchman "^2.0.0" + graceful-fs "^4.2.4" + invariant "^2.2.4" + jest-util "^27.2.0" + jest-worker "^27.2.0" + micromatch "^4.0.4" + node-abort-controller "^3.1.1" + nullthrows "^1.1.1" + walker "^1.0.7" + optionalDependencies: + fsevents "^2.3.2" + metro-inspector-proxy@0.76.7: version "0.76.7" resolved "https://registry.yarnpkg.com/metro-inspector-proxy/-/metro-inspector-proxy-0.76.7.tgz#c067df25056e932002a72a4b45cf7b4b749f808e" @@ -5060,6 +5307,13 @@ metro-minify-terser@0.76.7: dependencies: terser "^5.15.0" +metro-minify-terser@0.79.1: + version "0.79.1" + resolved "https://registry.yarnpkg.com/metro-minify-terser/-/metro-minify-terser-0.79.1.tgz#006479abd5eea43525937a3d211af2f4b0c3133f" + integrity sha512-69zOvPazJFKE6tHlOF8PQcvXUfoXgeHreVaggjuqnCREMWBjEkTH9jOn8M3oB0JgKmEUBb4bzFr7Oz1kC7Jc3g== + dependencies: + terser "^5.15.0" + metro-minify-uglify@0.76.7: version "0.76.7" resolved "https://registry.yarnpkg.com/metro-minify-uglify/-/metro-minify-uglify-0.76.7.tgz#3e0143786718dcaea4e28a724698d4f8ac199a43" @@ -5173,6 +5427,11 @@ metro-resolver@0.76.7: resolved "https://registry.yarnpkg.com/metro-resolver/-/metro-resolver-0.76.7.tgz#f00ebead64e451c060f30926ecbf4f797588df52" integrity sha512-pC0Wgq29HHIHrwz23xxiNgylhI8Rq1V01kQaJ9Kz11zWrIdlrH0ZdnJ7GC6qA0ErROG+cXmJ0rJb8/SW1Zp2IA== +metro-resolver@0.79.1: + version "0.79.1" + resolved "https://registry.yarnpkg.com/metro-resolver/-/metro-resolver-0.79.1.tgz#80e6e27305eb446188009f54374b642f28f49b65" + integrity sha512-hiea5co7c5rhrdD5xYohBq2Sw20Ytzie71raIW9SsXKBKzsS0zAbrwNFW5z71lDUnp719vhobnDXJ+yE7Kq9Gg== + metro-runtime@0.76.7: version "0.76.7" resolved "https://registry.yarnpkg.com/metro-runtime/-/metro-runtime-0.76.7.tgz#4d75f2dbbcd19a4f01e0d89494e140b0ba8247e4" @@ -5181,6 +5440,14 @@ metro-runtime@0.76.7: "@babel/runtime" "^7.0.0" react-refresh "^0.4.0" +metro-runtime@0.79.1: + version "0.79.1" + resolved "https://registry.yarnpkg.com/metro-runtime/-/metro-runtime-0.79.1.tgz#5598062de56a265b88cdfa735834809552829cf3" + integrity sha512-RRBFPjaex8/Q6M+4V0oOYrd4mDG0iNkRMSdT5iojUe9pF24pRmqwG2gm3NBBgh4UAzYPI0NsJ6AB8JTmchfCAg== + dependencies: + "@babel/runtime" "^7.0.0" + react-refresh "^0.4.0" + metro-source-map@0.76.7: version "0.76.7" resolved "https://registry.yarnpkg.com/metro-source-map/-/metro-source-map-0.76.7.tgz#9a4aa3a35e1e8ffde9a74cd7ab5f49d9d4a4da14" @@ -5195,6 +5462,20 @@ metro-source-map@0.76.7: source-map "^0.5.6" vlq "^1.0.0" +metro-source-map@0.79.1: + version "0.79.1" + resolved "https://registry.yarnpkg.com/metro-source-map/-/metro-source-map-0.79.1.tgz#6698910de296957207190f6376ef0d54f3b9b4cd" + integrity sha512-Rlgld4cfWUFs5NdAErSzWfX9C4eYLPXTBBmhTHaiQEgRb0ydrfhOcofT0gYTHzp6t9lW30IO5wxlzl6gU/nOjA== + dependencies: + "@babel/traverse" "^7.20.0" + "@babel/types" "^7.20.0" + invariant "^2.2.4" + metro-symbolicate "0.79.1" + nullthrows "^1.1.1" + ob1 "0.79.1" + source-map "^0.5.6" + vlq "^1.0.0" + metro-symbolicate@0.76.7: version "0.76.7" resolved "https://registry.yarnpkg.com/metro-symbolicate/-/metro-symbolicate-0.76.7.tgz#1720e6b4ce5676935d7a8a440f25d3f16638e87a" @@ -5207,6 +5488,18 @@ metro-symbolicate@0.76.7: through2 "^2.0.1" vlq "^1.0.0" +metro-symbolicate@0.79.1: + version "0.79.1" + resolved "https://registry.yarnpkg.com/metro-symbolicate/-/metro-symbolicate-0.79.1.tgz#29b8f59ac32e2381ec6e44023931b1118b04e4b4" + integrity sha512-cB7Yxh5SKs24EsTaONpaEPoFC6H1ya0BeAR1Ety1qeeV/gFmC8YvkwFj9S8sy6whwIf4dM9xLF2iv7Ug78C4JA== + dependencies: + invariant "^2.2.4" + metro-source-map "0.79.1" + nullthrows "^1.1.1" + source-map "^0.5.6" + through2 "^2.0.1" + vlq "^1.0.0" + metro-transform-plugins@0.76.7: version "0.76.7" resolved "https://registry.yarnpkg.com/metro-transform-plugins/-/metro-transform-plugins-0.76.7.tgz#5d5f75371706fbf5166288e43ffd36b5e5bd05bc" @@ -5218,6 +5511,17 @@ metro-transform-plugins@0.76.7: "@babel/traverse" "^7.20.0" nullthrows "^1.1.1" +metro-transform-plugins@0.79.1: + version "0.79.1" + resolved "https://registry.yarnpkg.com/metro-transform-plugins/-/metro-transform-plugins-0.79.1.tgz#103c6b5562954b6dab6b9c0b73b13742d17fcb87" + integrity sha512-kGDpBJGpijC/OVrpngCiyvzrT6sfSPqFOiyEzU02j+8UCmxKCofbdv62nT97dzseR+iWkzFPcCbq8Nc7/CFwwA== + dependencies: + "@babel/core" "^7.20.0" + "@babel/generator" "^7.20.0" + "@babel/template" "^7.0.0" + "@babel/traverse" "^7.20.0" + nullthrows "^1.1.1" + metro-transform-worker@0.76.7: version "0.76.7" resolved "https://registry.yarnpkg.com/metro-transform-worker/-/metro-transform-worker-0.76.7.tgz#b842d5a542f1806cca401633fc002559b3e3d668" @@ -5236,6 +5540,23 @@ metro-transform-worker@0.76.7: metro-transform-plugins "0.76.7" nullthrows "^1.1.1" +metro-transform-worker@0.79.1: + version "0.79.1" + resolved "https://registry.yarnpkg.com/metro-transform-worker/-/metro-transform-worker-0.79.1.tgz#1e48f68b532fbae15d6d82270519b9fc6e311598" + integrity sha512-WA15xo7EvJgutlhRKldgPTtwOWur4xDO5uQc5e/vZuhGtahcV0b4v2lXp+t3z5gs9DBqajsczce1A+3pY9wcQQ== + dependencies: + "@babel/core" "^7.20.0" + "@babel/generator" "^7.20.0" + "@babel/parser" "^7.20.0" + "@babel/types" "^7.20.0" + metro "0.79.1" + metro-babel-transformer "0.79.1" + metro-cache "0.79.1" + metro-cache-key "0.79.1" + metro-source-map "0.79.1" + metro-transform-plugins "0.79.1" + nullthrows "^1.1.1" + metro@0.76.7: version "0.76.7" resolved "https://registry.yarnpkg.com/metro/-/metro-0.76.7.tgz#4885917ad28738c7d1e556630e0155f687336230" @@ -5290,6 +5611,56 @@ metro@0.76.7: ws "^7.5.1" yargs "^17.6.2" +metro@0.79.1: + version "0.79.1" + resolved "https://registry.yarnpkg.com/metro/-/metro-0.79.1.tgz#e6e2db1d2aca30d88e419d97835572660aba2064" + integrity sha512-PDzLQn4fpV4cs6brPi3zSu3zOA3kG+x6algazYGz1FzrOIsIT+L0Hd294+V4xN73EjLrSD5vD5hNsWlBxRk/PA== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/core" "^7.20.0" + "@babel/generator" "^7.20.0" + "@babel/parser" "^7.20.0" + "@babel/template" "^7.0.0" + "@babel/traverse" "^7.20.0" + "@babel/types" "^7.20.0" + accepts "^1.3.7" + chalk "^4.0.0" + ci-info "^2.0.0" + connect "^3.6.5" + debug "^2.2.0" + denodeify "^1.2.1" + error-stack-parser "^2.0.6" + graceful-fs "^4.2.4" + hermes-parser "0.15.0" + image-size "^1.0.2" + invariant "^2.2.4" + jest-worker "^27.2.0" + jsc-safe-url "^0.2.2" + lodash.throttle "^4.1.1" + metro-babel-transformer "0.79.1" + metro-cache "0.79.1" + metro-cache-key "0.79.1" + metro-config "0.79.1" + metro-core "0.79.1" + metro-file-map "0.79.1" + metro-minify-terser "0.79.1" + metro-resolver "0.79.1" + metro-runtime "0.79.1" + metro-source-map "0.79.1" + metro-symbolicate "0.79.1" + metro-transform-plugins "0.79.1" + metro-transform-worker "0.79.1" + mime-types "^2.1.27" + node-fetch "^2.2.0" + nullthrows "^1.1.1" + rimraf "^3.0.2" + serialize-error "^2.1.0" + source-map "^0.5.6" + strip-ansi "^6.0.0" + throat "^5.0.0" + ws "^7.5.1" + yargs "^17.6.2" + micromatch@^4.0.4: version "4.0.5" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" @@ -5546,6 +5917,11 @@ ob1@0.76.7: resolved "https://registry.yarnpkg.com/ob1/-/ob1-0.76.7.tgz#95b68fadafd47e7a6a0ad64cf80f3140dd6d1124" integrity sha512-BQdRtxxoUNfSoZxqeBGOyuT9nEYSn18xZHwGMb0mMVpn2NBcYbnyKY4BK2LIHRgw33CBGlUmE+KMaNvyTpLLtQ== +ob1@0.79.1: + version "0.79.1" + resolved "https://registry.yarnpkg.com/ob1/-/ob1-0.79.1.tgz#11d43712ff2c089d576b13b05b0caeed28389c6b" + integrity sha512-Z05NdP9uwS6UWoqNQDqx/VuVBD7rhMBqCB52js9HRct5IsU/lcSC/9Rv4J977wcOrSmaYTXQa2HRkUg4QAIS3g== + object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -5747,6 +6123,15 @@ pretty-format@^29.0.0, pretty-format@^29.6.2: ansi-styles "^5.0.0" react-is "^18.0.0" +pretty-format@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" + integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ== + dependencies: + "@jest/schemas" "^29.6.3" + ansi-styles "^5.0.0" + react-is "^18.0.0" + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -5926,6 +6311,11 @@ react-native@0.72.3: ws "^6.2.2" yargs "^17.6.2" +react-refresh@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.14.0.tgz#4e02825378a5f227079554d4284889354e5f553e" + integrity sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ== + react-refresh@^0.4.0: version "0.4.3" resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.4.3.tgz#966f1750c191672e76e16c2efa569150cc73ab53" From dad7e7590974b6c26449091d17b29f4f9ada64de Mon Sep 17 00:00:00 2001 From: Ahmed Mahmoud Date: Wed, 18 Oct 2023 15:57:42 +0300 Subject: [PATCH 2/3] fix: add prettier import orders to plugins --- .prettierrc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.prettierrc.js b/.prettierrc.js index a5bc64a7c..9522cb2c7 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -11,4 +11,5 @@ module.exports = { importOrder: ['mocks', '^react(-native)?(/.*)?$', '', '^[./]'], importOrderSeparation: true, importOrderSortSpecifiers: true, + plugins: ['@trivago/prettier-plugin-sort-imports'], }; From 3d8a3aa08ed1634c6aca9b2a776591d9bb757137 Mon Sep 17 00:00:00 2001 From: Ahmed Mahmoud Date: Wed, 18 Oct 2023 15:59:25 +0300 Subject: [PATCH 3/3] chore: reformat files to re-order imports --- src/index.ts | 2 +- src/modules/BugReporting.ts | 1 - src/modules/Instabug.ts | 4 ++-- src/native/NativePackage.ts | 2 +- src/utils/UnhandledRejectionTracking.ts | 3 ++- test/mocks/mockNativeModules.ts | 2 +- test/setup.ts | 2 +- test/utils/UnhandledRejectionTracking.spec.ts | 9 +++++---- 8 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/index.ts b/src/index.ts index a6c425fcd..4ea1f4d90 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,9 +11,9 @@ import * as Instabug from './modules/Instabug'; import * as NetworkLogger from './modules/NetworkLogger'; import type { NetworkData, NetworkDataObfuscationHandler } from './modules/NetworkLogger'; import * as Replies from './modules/Replies'; +import * as SessionReplay from './modules/SessionReplay'; import type { Survey } from './modules/Surveys'; import * as Surveys from './modules/Surveys'; -import * as SessionReplay from './modules/SessionReplay'; export * from './utils/Enums'; export { diff --git a/src/modules/BugReporting.ts b/src/modules/BugReporting.ts index 2883cbc5d..cedef1aac 100644 --- a/src/modules/BugReporting.ts +++ b/src/modules/BugReporting.ts @@ -1,7 +1,6 @@ import { Platform } from 'react-native'; import { NativeBugReporting, NativeEvents, emitter } from '../native/NativeBugReporting'; - import type { DismissType, ExtendedBugReportMode, diff --git a/src/modules/Instabug.ts b/src/modules/Instabug.ts index 58dbee0d3..693de1323 100644 --- a/src/modules/Instabug.ts +++ b/src/modules/Instabug.ts @@ -7,6 +7,7 @@ import type { NavigationAction, NavigationState as NavigationStateV4 } from 'rea import type { InstabugConfig } from '../models/InstabugConfig'; import Report from '../models/Report'; +import type { ReproConfig } from '../models/ReproConfig'; import { NativeEvents, NativeInstabug, emitter } from '../native/NativeInstabug'; import { ColorTheme, @@ -17,9 +18,8 @@ import { WelcomeMessageMode, } from '../utils/Enums'; import InstabugUtils, { stringifyIfNotString } from '../utils/InstabugUtils'; -import * as NetworkLogger from './NetworkLogger'; import { captureUnhandledRejections } from '../utils/UnhandledRejectionTracking'; -import type { ReproConfig } from '../models/ReproConfig'; +import * as NetworkLogger from './NetworkLogger'; let _currentScreen: string | null = null; let _lastScreen: string | null = null; diff --git a/src/native/NativePackage.ts b/src/native/NativePackage.ts index 9c31789bd..10f93fbee 100644 --- a/src/native/NativePackage.ts +++ b/src/native/NativePackage.ts @@ -6,8 +6,8 @@ import type { CrashReportingNativeModule } from './NativeCrashReporting'; import type { FeatureRequestsNativeModule } from './NativeFeatureRequests'; import type { InstabugNativeModule } from './NativeInstabug'; import type { RepliesNativeModule } from './NativeReplies'; -import type { SurveysNativeModule } from './NativeSurveys'; import type { SessionReplayNativeModule } from './NativeSessionReplay'; +import type { SurveysNativeModule } from './NativeSurveys'; export interface InstabugNativePackage { IBGAPM: ApmNativeModule; diff --git a/src/utils/UnhandledRejectionTracking.ts b/src/utils/UnhandledRejectionTracking.ts index 9bc550671..25552a031 100644 --- a/src/utils/UnhandledRejectionTracking.ts +++ b/src/utils/UnhandledRejectionTracking.ts @@ -1,6 +1,7 @@ import tracking, { RejectionTrackingOptions } from 'promise/setimmediate/rejection-tracking'; -import { sendCrashReport } from './InstabugUtils'; + import { NativeCrashReporting } from '../native/NativeCrashReporting'; +import { sendCrashReport } from './InstabugUtils'; export interface HermesInternalType { enablePromiseRejectionTracker?: (options?: RejectionTrackingOptions) => void; diff --git a/test/mocks/mockNativeModules.ts b/test/mocks/mockNativeModules.ts index 5618930e8..a70f1dd38 100644 --- a/test/mocks/mockNativeModules.ts +++ b/test/mocks/mockNativeModules.ts @@ -3,9 +3,9 @@ import mockAPM from './mockAPM'; import mockBugReporting from './mockBugReporting'; import mockCrashReporting from './mockCrashReporting'; import mockFeatureRequests from './mockFeatureRequests'; -import mockSessionReplay from './mockSessionReplay'; import mockInstabug from './mockInstabug'; import mockReplies from './mockReplies'; +import mockSessionReplay from './mockSessionReplay'; import mockSurveys from './mockSurveys'; jest.mock('react-native', () => { diff --git a/test/setup.ts b/test/setup.ts index 698cb7ad7..759c7e840 100644 --- a/test/setup.ts +++ b/test/setup.ts @@ -1,6 +1,6 @@ import './mocks/mockNativeModules'; -import './mocks/mockPromiseRejectionTracking'; import './mocks/mockParseErrorStackLib'; +import './mocks/mockPromiseRejectionTracking'; import { Platform } from 'react-native'; import 'react-native/Libraries/Network/fetch'; diff --git a/test/utils/UnhandledRejectionTracking.spec.ts b/test/utils/UnhandledRejectionTracking.spec.ts index 7afffb936..9c3b614ea 100644 --- a/test/utils/UnhandledRejectionTracking.spec.ts +++ b/test/utils/UnhandledRejectionTracking.spec.ts @@ -1,11 +1,12 @@ /// - -import tracking from 'promise/setimmediate/rejection-tracking'; -import { captureUnhandledRejections } from '../../src/utils/UnhandledRejectionTracking'; -import { mockHermesInternal } from '../mocks/mockHermesInternal'; import { mockDevMode } from '../mocks/mockDevMode'; +import { mockHermesInternal } from '../mocks/mockHermesInternal'; + import { mocked } from 'jest-mock'; +import tracking from 'promise/setimmediate/rejection-tracking'; + import { NativeCrashReporting } from '../../src/native/NativeCrashReporting'; +import { captureUnhandledRejections } from '../../src/utils/UnhandledRejectionTracking'; it('tracks Promise rejections when using Hermes', () => { const enablePromiseRejectionTracker = jest.fn();