From 07b3e0157507d4ef326f864a85e46f41a2c4a62f Mon Sep 17 00:00:00 2001 From: Tim Roberts Date: Tue, 3 Dec 2024 09:01:35 +0000 Subject: [PATCH 1/4] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20upgrade=20expo=20deps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/example-expo/package.json | 4 +- yarn.lock | 416 +++++++++++++++++++++++++---- 2 files changed, 367 insertions(+), 53 deletions(-) diff --git a/examples/example-expo/package.json b/examples/example-expo/package.json index a347c5c..9c13dfa 100644 --- a/examples/example-expo/package.json +++ b/examples/example-expo/package.json @@ -10,12 +10,12 @@ }, "dependencies": { "@expo/vector-icons": "^14.0.3", - "expo": "^52.0.0", + "expo": "^52.0.11", "expo-av": "~15.0.1", "expo-haptics": "~14.0.0", "expo-linear-gradient": "~14.0.1", "react": "18.3.1", - "react-native": "0.76.2" + "react-native": "0.76.3" }, "devDependencies": { "@babel/core": "^7.24.0", diff --git a/yarn.lock b/yarn.lock index f2cb59d..1bd538b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1789,15 +1789,15 @@ __metadata: languageName: node linkType: hard -"@expo/cli@npm:0.21.5": - version: 0.21.5 - resolution: "@expo/cli@npm:0.21.5" +"@expo/cli@npm:0.22.0": + version: 0.22.0 + resolution: "@expo/cli@npm:0.22.0" dependencies: "@0no-co/graphql.web": ^1.0.8 "@babel/runtime": ^7.20.0 "@expo/code-signing-certificates": ^0.0.5 "@expo/config": ~10.0.4 - "@expo/config-plugins": ~9.0.3 + "@expo/config-plugins": ~9.0.10 "@expo/devcert": ^1.1.2 "@expo/env": ~0.4.0 "@expo/image-utils": ^0.6.0 @@ -1806,11 +1806,11 @@ __metadata: "@expo/osascript": ^2.0.31 "@expo/package-manager": ^1.5.0 "@expo/plist": ^0.2.0 - "@expo/prebuild-config": ^8.0.16 + "@expo/prebuild-config": ^8.0.17 "@expo/rudder-sdk-node": ^1.1.1 "@expo/spawn-async": ^1.7.2 "@expo/xcpretty": ^4.3.0 - "@react-native/dev-middleware": 0.76.2 + "@react-native/dev-middleware": 0.76.3 "@urql/core": ^5.0.6 "@urql/exchange-retry": ^1.3.0 accepts: ^1.3.8 @@ -1866,7 +1866,7 @@ __metadata: ws: ^8.12.1 bin: expo-internal: build/bin/cli - checksum: e2dee2444589aa6b21dd96b39258127453cb02a60da9fa39dc1544596fe741496fa1fd13be07500cf72138ee826a3a9bd60c9e88f0db77676152c3a3332ea110 + checksum: 69761fd1ecb26e596a3bff0359629aada9298ddbb9dfd923007d254c501da0e540eafb33d0c40b3dae18ab5a4b12b7150263202040aabd9c11332abd0a2f66ff languageName: node linkType: hard @@ -1880,7 +1880,7 @@ __metadata: languageName: node linkType: hard -"@expo/config-plugins@npm:9.0.9, @expo/config-plugins@npm:~9.0.0, @expo/config-plugins@npm:~9.0.3": +"@expo/config-plugins@npm:~9.0.0": version: 9.0.9 resolution: "@expo/config-plugins@npm:9.0.9" dependencies: @@ -1902,6 +1902,28 @@ __metadata: languageName: node linkType: hard +"@expo/config-plugins@npm:~9.0.10, @expo/config-plugins@npm:~9.0.11": + version: 9.0.11 + resolution: "@expo/config-plugins@npm:9.0.11" + dependencies: + "@expo/config-types": ^52.0.0 + "@expo/json-file": ~9.0.0 + "@expo/plist": ^0.2.0 + "@expo/sdk-runtime-versions": ^1.0.0 + chalk: ^4.1.2 + debug: ^4.3.5 + getenv: ^1.0.0 + glob: ^10.4.2 + resolve-from: ^5.0.0 + semver: ^7.5.4 + slash: ^3.0.0 + slugify: ^1.6.6 + xcode: ^3.0.1 + xml2js: 0.6.0 + checksum: cceaeaa16e053bb8b2ee8be13f0f8b73e92021e6b5015462923afd9e826e95fd30e246eda4901959f3e19fa2b2c0f52192166873f97ece5b3d2beb0dace7195f + languageName: node + linkType: hard + "@expo/config-types@npm:^52.0.0": version: 52.0.1 resolution: "@expo/config-types@npm:52.0.1" @@ -1930,6 +1952,27 @@ __metadata: languageName: node linkType: hard +"@expo/config@npm:~10.0.5": + version: 10.0.5 + resolution: "@expo/config@npm:10.0.5" + dependencies: + "@babel/code-frame": ~7.10.4 + "@expo/config-plugins": ~9.0.10 + "@expo/config-types": ^52.0.0 + "@expo/json-file": ^9.0.0 + deepmerge: ^4.3.1 + getenv: ^1.0.0 + glob: ^10.4.2 + require-from-string: ^2.0.2 + resolve-from: ^5.0.0 + resolve-workspace-root: ^2.0.0 + semver: ^7.6.0 + slugify: ^1.3.4 + sucrase: 3.35.0 + checksum: b6676dbdc091d72284ea58ba58f7fff8c078f5247a122d51a2d5ea14f68f968730830a905b0ab39163e8cc25255829df5fa23928d33ad226a198e6e8d7d799dc + languageName: node + linkType: hard + "@expo/devcert@npm:^1.1.2": version: 1.1.4 resolution: "@expo/devcert@npm:1.1.4" @@ -1963,9 +2006,9 @@ __metadata: languageName: node linkType: hard -"@expo/fingerprint@npm:0.11.2": - version: 0.11.2 - resolution: "@expo/fingerprint@npm:0.11.2" +"@expo/fingerprint@npm:0.11.3": + version: 0.11.3 + resolution: "@expo/fingerprint@npm:0.11.3" dependencies: "@expo/spawn-async": ^1.7.2 arg: ^5.0.2 @@ -1979,7 +2022,7 @@ __metadata: semver: ^7.6.0 bin: fingerprint: bin/cli.js - checksum: 278d7a496ea6b89d520784350de924d2dc2af19454b5023abd34be3c47641c2856cacac74c7bdbe35905bf5525e19371c1f39b644026f6cbea23f4294fefb676 + checksum: 2bc78cf0ff6da029c778fda1c7cd225876daa1335dec11f35510a535b37c09c68dc38c8525360fd7ce407a75c8dcb03cfa5c101655323abd05137e788bab9af8 languageName: node linkType: hard @@ -2012,7 +2055,33 @@ __metadata: languageName: node linkType: hard -"@expo/metro-config@npm:0.19.4, @expo/metro-config@npm:~0.19.0": +"@expo/metro-config@npm:0.19.5": + version: 0.19.5 + resolution: "@expo/metro-config@npm:0.19.5" + dependencies: + "@babel/core": ^7.20.0 + "@babel/generator": ^7.20.5 + "@babel/parser": ^7.20.0 + "@babel/types": ^7.20.0 + "@expo/config": ~10.0.4 + "@expo/env": ~0.4.0 + "@expo/json-file": ~9.0.0 + "@expo/spawn-async": ^1.7.2 + chalk: ^4.1.0 + debug: ^4.3.2 + fs-extra: ^9.1.0 + getenv: ^1.0.0 + glob: ^10.4.2 + jsc-safe-url: ^0.2.4 + lightningcss: ~1.27.0 + minimatch: ^3.0.4 + postcss: ~8.4.32 + resolve-from: ^5.0.0 + checksum: bbb5c09409db9f9ae88ec90f4214916bdb63541431b2933625c29cf2ecf607622921750147043136b8692305d99255b168da75af028e3f5c1eb4105c4dfcc070 + languageName: node + linkType: hard + +"@expo/metro-config@npm:~0.19.0": version: 0.19.4 resolution: "@expo/metro-config@npm:0.19.4" dependencies: @@ -2079,22 +2148,22 @@ __metadata: languageName: node linkType: hard -"@expo/prebuild-config@npm:^8.0.16": - version: 8.0.17 - resolution: "@expo/prebuild-config@npm:8.0.17" +"@expo/prebuild-config@npm:^8.0.17": + version: 8.0.21 + resolution: "@expo/prebuild-config@npm:8.0.21" dependencies: "@expo/config": ~10.0.4 - "@expo/config-plugins": ~9.0.0 + "@expo/config-plugins": ~9.0.10 "@expo/config-types": ^52.0.0 "@expo/image-utils": ^0.6.0 "@expo/json-file": ^9.0.0 - "@react-native/normalize-colors": 0.76.2 + "@react-native/normalize-colors": 0.76.3 debug: ^4.3.1 fs-extra: ^9.0.0 resolve-from: ^5.0.0 semver: ^7.6.0 xml2js: 0.6.0 - checksum: 34c392b4e56570504363ea78612cd919c3a83a00df0d2e9a304e06d32d9d5a08ca8b02f649a8e4b81c6f5439fa188a9b9de5d94c8b87f2ee19cf888a5ac23280 + checksum: ff98989a45bdd1a91e74a82ae3f6163bd70f233f7d58efc74c0a89ab06611d5cdf9eebb1938ec6aa11bcb7d40ea8810908ae563eed57e9a584e1aefb64eccfec languageName: node linkType: hard @@ -2819,6 +2888,13 @@ __metadata: languageName: node linkType: hard +"@react-native/assets-registry@npm:0.76.3": + version: 0.76.3 + resolution: "@react-native/assets-registry@npm:0.76.3" + checksum: 0a5c3d63eec8ce9e29be9e0cca6aa0bc62580b9820caf948fc44574be75e166b836caa1cd4b53550c880996b36389fb8f2b18652c3e6abeddecc9ca835cd9296 + languageName: node + linkType: hard + "@react-native/babel-plugin-codegen@npm:0.76.2": version: 0.76.2 resolution: "@react-native/babel-plugin-codegen@npm:0.76.2" @@ -2828,6 +2904,15 @@ __metadata: languageName: node linkType: hard +"@react-native/babel-plugin-codegen@npm:0.76.3": + version: 0.76.3 + resolution: "@react-native/babel-plugin-codegen@npm:0.76.3" + dependencies: + "@react-native/codegen": 0.76.3 + checksum: db24d3d7f89d1aca30fd1a5050deb86982aba54c7df5ac5dc73bcae4ba07275a08af92db1ae383e44366ba206f941333d2a972672db8a57cbd825f4bacea5c0c + languageName: node + linkType: hard + "@react-native/babel-preset@npm:0.76.2": version: 0.76.2 resolution: "@react-native/babel-preset@npm:0.76.2" @@ -2883,6 +2968,61 @@ __metadata: languageName: node linkType: hard +"@react-native/babel-preset@npm:0.76.3": + version: 0.76.3 + resolution: "@react-native/babel-preset@npm:0.76.3" + dependencies: + "@babel/core": ^7.25.2 + "@babel/plugin-proposal-export-default-from": ^7.24.7 + "@babel/plugin-syntax-dynamic-import": ^7.8.3 + "@babel/plugin-syntax-export-default-from": ^7.24.7 + "@babel/plugin-syntax-nullish-coalescing-operator": ^7.8.3 + "@babel/plugin-syntax-optional-chaining": ^7.8.3 + "@babel/plugin-transform-arrow-functions": ^7.24.7 + "@babel/plugin-transform-async-generator-functions": ^7.25.4 + "@babel/plugin-transform-async-to-generator": ^7.24.7 + "@babel/plugin-transform-block-scoping": ^7.25.0 + "@babel/plugin-transform-class-properties": ^7.25.4 + "@babel/plugin-transform-classes": ^7.25.4 + "@babel/plugin-transform-computed-properties": ^7.24.7 + "@babel/plugin-transform-destructuring": ^7.24.8 + "@babel/plugin-transform-flow-strip-types": ^7.25.2 + "@babel/plugin-transform-for-of": ^7.24.7 + "@babel/plugin-transform-function-name": ^7.25.1 + "@babel/plugin-transform-literals": ^7.25.2 + "@babel/plugin-transform-logical-assignment-operators": ^7.24.7 + "@babel/plugin-transform-modules-commonjs": ^7.24.8 + "@babel/plugin-transform-named-capturing-groups-regex": ^7.24.7 + "@babel/plugin-transform-nullish-coalescing-operator": ^7.24.7 + "@babel/plugin-transform-numeric-separator": ^7.24.7 + "@babel/plugin-transform-object-rest-spread": ^7.24.7 + "@babel/plugin-transform-optional-catch-binding": ^7.24.7 + "@babel/plugin-transform-optional-chaining": ^7.24.8 + "@babel/plugin-transform-parameters": ^7.24.7 + "@babel/plugin-transform-private-methods": ^7.24.7 + "@babel/plugin-transform-private-property-in-object": ^7.24.7 + "@babel/plugin-transform-react-display-name": ^7.24.7 + "@babel/plugin-transform-react-jsx": ^7.25.2 + "@babel/plugin-transform-react-jsx-self": ^7.24.7 + "@babel/plugin-transform-react-jsx-source": ^7.24.7 + "@babel/plugin-transform-regenerator": ^7.24.7 + "@babel/plugin-transform-runtime": ^7.24.7 + "@babel/plugin-transform-shorthand-properties": ^7.24.7 + "@babel/plugin-transform-spread": ^7.24.7 + "@babel/plugin-transform-sticky-regex": ^7.24.7 + "@babel/plugin-transform-typescript": ^7.25.2 + "@babel/plugin-transform-unicode-regex": ^7.24.7 + "@babel/template": ^7.25.0 + "@react-native/babel-plugin-codegen": 0.76.3 + babel-plugin-syntax-hermes-parser: ^0.25.1 + babel-plugin-transform-flow-enums: ^0.0.2 + react-refresh: ^0.14.0 + peerDependencies: + "@babel/core": "*" + checksum: 012476667ad1596a0ae45b0b0d0404af724766aa170b22a80f56c4302060e2f5b90bef24a41aef2dd12cbe672a31b8c5c13f72b974cfaad004aef452ac17995c + languageName: node + linkType: hard + "@react-native/codegen@npm:0.76.2": version: 0.76.2 resolution: "@react-native/codegen@npm:0.76.2" @@ -2901,6 +3041,24 @@ __metadata: languageName: node linkType: hard +"@react-native/codegen@npm:0.76.3": + version: 0.76.3 + resolution: "@react-native/codegen@npm:0.76.3" + dependencies: + "@babel/parser": ^7.25.3 + glob: ^7.1.1 + hermes-parser: 0.23.1 + invariant: ^2.2.4 + jscodeshift: ^0.14.0 + mkdirp: ^0.5.1 + nullthrows: ^1.1.1 + yargs: ^17.6.2 + peerDependencies: + "@babel/preset-env": ^7.1.6 + checksum: 5e9677695dcddabcd045ee448472cdecb13d6db216d021a21e29830487cfaef790ff6c1e59de06a7d70d18cc816dcd939c2cbbfa5c58b78b27d04f3cbacbc5ac + languageName: node + linkType: hard + "@react-native/community-cli-plugin@npm:0.76.2": version: 0.76.2 resolution: "@react-native/community-cli-plugin@npm:0.76.2" @@ -2925,6 +3083,30 @@ __metadata: languageName: node linkType: hard +"@react-native/community-cli-plugin@npm:0.76.3": + version: 0.76.3 + resolution: "@react-native/community-cli-plugin@npm:0.76.3" + dependencies: + "@react-native/dev-middleware": 0.76.3 + "@react-native/metro-babel-transformer": 0.76.3 + chalk: ^4.0.0 + execa: ^5.1.1 + invariant: ^2.2.4 + metro: ^0.81.0 + metro-config: ^0.81.0 + metro-core: ^0.81.0 + node-fetch: ^2.2.0 + readline: ^1.3.0 + semver: ^7.1.3 + peerDependencies: + "@react-native-community/cli-server-api": "*" + peerDependenciesMeta: + "@react-native-community/cli-server-api": + optional: true + checksum: 7d3c76ac702f97a8d75ad1d8e0cedfef7061ed25ed26dde7d39214a26a42b8c594bc8ba9d1cfa8e83fae0069828340b207c771677431619bd1039aa99d9d8032 + languageName: node + linkType: hard + "@react-native/debugger-frontend@npm:0.76.2": version: 0.76.2 resolution: "@react-native/debugger-frontend@npm:0.76.2" @@ -2932,6 +3114,13 @@ __metadata: languageName: node linkType: hard +"@react-native/debugger-frontend@npm:0.76.3": + version: 0.76.3 + resolution: "@react-native/debugger-frontend@npm:0.76.3" + checksum: 549fea784b9e03a0e4bb05befea92af096705595e34fa6540873b1f00641ceaac3dafaeda212dd80d049f82d0929852c7fb1870bd823158ad780a5c2edfdcf0a + languageName: node + linkType: hard + "@react-native/dev-middleware@npm:0.76.2": version: 0.76.2 resolution: "@react-native/dev-middleware@npm:0.76.2" @@ -2951,6 +3140,25 @@ __metadata: languageName: node linkType: hard +"@react-native/dev-middleware@npm:0.76.3": + version: 0.76.3 + resolution: "@react-native/dev-middleware@npm:0.76.3" + dependencies: + "@isaacs/ttlcache": ^1.4.1 + "@react-native/debugger-frontend": 0.76.3 + chrome-launcher: ^0.15.2 + chromium-edge-launcher: ^0.2.0 + connect: ^3.6.5 + debug: ^2.2.0 + nullthrows: ^1.1.1 + open: ^7.0.3 + selfsigned: ^2.4.1 + serve-static: ^1.13.1 + ws: ^6.2.3 + checksum: 77acfecd6b59594d892afb63efcc54474a38278f233db6163bdf66329603bdb485dc304e0c9a58c5c19c1d7397cfb6b76f08bd5f136d130052db9d73ae6b74b5 + languageName: node + linkType: hard + "@react-native/eslint-config@npm:0.76.2": version: 0.76.2 resolution: "@react-native/eslint-config@npm:0.76.2" @@ -2989,6 +3197,13 @@ __metadata: languageName: node linkType: hard +"@react-native/gradle-plugin@npm:0.76.3": + version: 0.76.3 + resolution: "@react-native/gradle-plugin@npm:0.76.3" + checksum: 7bde3ae9cbf21f59adc5583cfe25d245ca2921f50d50361e763a59bb02398206c93e61c935a4605609de7e1fe49450594ff56b0b9ccecc07065dbe4c9e9217c6 + languageName: node + linkType: hard + "@react-native/js-polyfills@npm:0.76.2": version: 0.76.2 resolution: "@react-native/js-polyfills@npm:0.76.2" @@ -2996,6 +3211,13 @@ __metadata: languageName: node linkType: hard +"@react-native/js-polyfills@npm:0.76.3": + version: 0.76.3 + resolution: "@react-native/js-polyfills@npm:0.76.3" + checksum: a33145ee39fe9de0e8b4b3a25cd263d775fe14ac3c4f77c4dc6a77a60c06febacdcefd7271c9aaa2a13336bada413601e3fa3de51eb7e44387b53055d99a1b69 + languageName: node + linkType: hard + "@react-native/metro-babel-transformer@npm:0.76.2": version: 0.76.2 resolution: "@react-native/metro-babel-transformer@npm:0.76.2" @@ -3010,6 +3232,20 @@ __metadata: languageName: node linkType: hard +"@react-native/metro-babel-transformer@npm:0.76.3": + version: 0.76.3 + resolution: "@react-native/metro-babel-transformer@npm:0.76.3" + dependencies: + "@babel/core": ^7.25.2 + "@react-native/babel-preset": 0.76.3 + hermes-parser: 0.23.1 + nullthrows: ^1.1.1 + peerDependencies: + "@babel/core": "*" + checksum: 26be14f178dbfac8f8c75c8c2a87e582e274f4f8fc8f8860e804de042167238b80d8606a1357296240aa59085a9275e4be6797a80afdeed2cbcaa7cf7d8c1793 + languageName: node + linkType: hard + "@react-native/metro-config@npm:0.76.2": version: 0.76.2 resolution: "@react-native/metro-config@npm:0.76.2" @@ -3029,6 +3265,13 @@ __metadata: languageName: node linkType: hard +"@react-native/normalize-colors@npm:0.76.3": + version: 0.76.3 + resolution: "@react-native/normalize-colors@npm:0.76.3" + checksum: 71ce0cbaa52fc87552b0ad83dd3ebd0a76253b7aacdc82ead09a0ada6349457b9927ed10452cb63b89fc18d793852eafaec18f2c79603dbf9dcadb676b2db477 + languageName: node + linkType: hard + "@react-native/typescript-config@npm:0.76.2": version: 0.76.2 resolution: "@react-native/typescript-config@npm:0.76.2" @@ -3053,6 +3296,23 @@ __metadata: languageName: node linkType: hard +"@react-native/virtualized-lists@npm:0.76.3": + version: 0.76.3 + resolution: "@react-native/virtualized-lists@npm:0.76.3" + dependencies: + invariant: ^2.2.4 + nullthrows: ^1.1.1 + peerDependencies: + "@types/react": ^18.2.6 + react: "*" + react-native: "*" + peerDependenciesMeta: + "@types/react": + optional: true + checksum: b84df110406651a025b9d798cb4511bc7c6db37b44ec885c92bbbc9a220bdd77837a13116d54fe59c16d35ffff013e3c87c28ffa870eb9b9f840d779cef68f90 + languageName: node + linkType: hard + "@rtsao/scc@npm:^1.1.0": version: 1.1.0 resolution: "@rtsao/scc@npm:1.1.0" @@ -4271,9 +4531,9 @@ __metadata: languageName: node linkType: hard -"babel-preset-expo@npm:~12.0.1": - version: 12.0.1 - resolution: "babel-preset-expo@npm:12.0.1" +"babel-preset-expo@npm:~12.0.3": + version: 12.0.3 + resolution: "babel-preset-expo@npm:12.0.3" dependencies: "@babel/plugin-proposal-decorators": ^7.12.9 "@babel/plugin-transform-export-namespace-from": ^7.22.11 @@ -4281,7 +4541,7 @@ __metadata: "@babel/plugin-transform-parameters": ^7.22.15 "@babel/preset-react": ^7.22.15 "@babel/preset-typescript": ^7.23.0 - "@react-native/babel-preset": 0.76.2 + "@react-native/babel-preset": 0.76.3 babel-plugin-react-native-web: ~0.19.13 react-refresh: ^0.14.2 peerDependencies: @@ -4292,7 +4552,7 @@ __metadata: optional: true react-compiler-runtime: optional: true - checksum: 78cb33340f53274e1a3fb40c64cbc6366ad5bdeb14da6792c67d51659ed720c5fb9e39ebe2540c66710d27310ff3f8c1b223b277f6d38c39dbfb78aff9edabb9 + checksum: 8ef64b764192cf0bfa898a9596ca6f9b80dd35d72436432e43eb65ca7cccf5200412353370dc970a12cf2a149677a7d31939884f7b2946a92034ccbf0945511a languageName: node linkType: hard @@ -6072,12 +6332,12 @@ __metadata: eslint: ">=8.44.0" eslint-plugin-react: ">=7.33.1" eslint-plugin-react-hooks: ">=4.6.0" - expo: ^52.0.0 + expo: ^52.0.11 expo-av: ~15.0.1 expo-haptics: ~14.0.0 expo-linear-gradient: ~14.0.1 react: 18.3.1 - react-native: 0.76.2 + react-native: 0.76.3 typescript: ~5.3.3 languageName: unknown linkType: soft @@ -6202,15 +6462,15 @@ __metadata: languageName: node linkType: hard -"expo-file-system@npm:~18.0.3": - version: 18.0.3 - resolution: "expo-file-system@npm:18.0.3" +"expo-file-system@npm:~18.0.4": + version: 18.0.4 + resolution: "expo-file-system@npm:18.0.4" dependencies: web-streams-polyfill: ^3.3.2 peerDependencies: expo: "*" react-native: "*" - checksum: f23f507859ccbe03c674014802d885f1513bb60454ab3415c329bd15017eea3df6f5195d136e8cf3cb89f828b26dc8c7023102e19f74897dbeac7b37d00270a4 + checksum: ac5b433d1664adc1592cc1086bc49b44d5b4d0fd8c5d40d2f5828560c79e3cc8eece5729046ff2302f16347a452f1b82678252dde2c8c8f2e51cbf5df178e36c languageName: node linkType: hard @@ -6256,9 +6516,9 @@ __metadata: languageName: node linkType: hard -"expo-modules-autolinking@npm:2.0.2": - version: 2.0.2 - resolution: "expo-modules-autolinking@npm:2.0.2" +"expo-modules-autolinking@npm:2.0.3": + version: 2.0.3 + resolution: "expo-modules-autolinking@npm:2.0.3" dependencies: "@expo/spawn-async": ^1.7.2 chalk: ^4.1.0 @@ -6270,38 +6530,38 @@ __metadata: resolve-from: ^5.0.0 bin: expo-modules-autolinking: bin/expo-modules-autolinking.js - checksum: f1e7493069ed9eae2333577a7440a5432d4bfa9ab8c9a13f51d221bd6e472c3ea9783996fd0d4bbac43ae4cde3c8518bec38957572ce4c01c959db093730f43a + checksum: bc6593600b789ee146fe6c0bf83d031d1ac9b0a2b652c04aacc278441ee2e3c05f26cfccac36e95d0c5ae2480cdb7c5a7d47aa606c4a5dfbc058b6eb7e93ba19 languageName: node linkType: hard -"expo-modules-core@npm:2.0.3": - version: 2.0.3 - resolution: "expo-modules-core@npm:2.0.3" +"expo-modules-core@npm:2.1.1": + version: 2.1.1 + resolution: "expo-modules-core@npm:2.1.1" dependencies: invariant: ^2.2.4 - checksum: 309d0fa68a57c89dd21dc28d3b5fc2133175323e3e02f797b1545833d12ebe556742f3bbac273b9cf87afcecaba2d4047f68fe97760a768885a2cb7bfc01f28e + checksum: 3453031fe63d3230bd50fcd2e47cd2da559f6b0b284664956c498da6e54a163d77269ab455ca7f09c51ab41915479b61abb13c5ea30ee75bf6f5a22ec3becced languageName: node linkType: hard -"expo@npm:^52.0.0": - version: 52.0.7 - resolution: "expo@npm:52.0.7" +"expo@npm:^52.0.11": + version: 52.0.14 + resolution: "expo@npm:52.0.14" dependencies: "@babel/runtime": ^7.20.0 - "@expo/cli": 0.21.5 - "@expo/config": ~10.0.4 - "@expo/config-plugins": 9.0.9 - "@expo/fingerprint": 0.11.2 - "@expo/metro-config": 0.19.4 + "@expo/cli": 0.22.0 + "@expo/config": ~10.0.5 + "@expo/config-plugins": ~9.0.11 + "@expo/fingerprint": 0.11.3 + "@expo/metro-config": 0.19.5 "@expo/vector-icons": ^14.0.0 - babel-preset-expo: ~12.0.1 + babel-preset-expo: ~12.0.3 expo-asset: ~11.0.1 expo-constants: ~17.0.3 - expo-file-system: ~18.0.3 + expo-file-system: ~18.0.4 expo-font: ~13.0.1 expo-keep-awake: ~14.0.1 - expo-modules-autolinking: 2.0.2 - expo-modules-core: 2.0.3 + expo-modules-autolinking: 2.0.3 + expo-modules-core: 2.1.1 fbemitter: ^3.0.0 web-streams-polyfill: ^3.3.2 whatwg-url-without-unicode: 8.0.0-3 @@ -6320,7 +6580,7 @@ __metadata: optional: true bin: expo: bin/cli - checksum: 5e9d437619e16e46d36cfbf2ab65c6dbee6316d8992162479c766d5a0bd6fbd4b31f954638df7f8101c257fd6fbf368487a298a8d861fa6beab14c0618f3ab4d + checksum: 0672f2731ff1647db9285b309f72f02684e8c2eb28850908bf83a6c0c49a4196e62effd03a3bcc787a4d3176c19a8461bdb8b5b0a1a03286410673a3227ec5c5 languageName: node linkType: hard @@ -10424,6 +10684,60 @@ __metadata: languageName: node linkType: hard +"react-native@npm:0.76.3": + version: 0.76.3 + resolution: "react-native@npm:0.76.3" + dependencies: + "@jest/create-cache-key-function": ^29.6.3 + "@react-native/assets-registry": 0.76.3 + "@react-native/codegen": 0.76.3 + "@react-native/community-cli-plugin": 0.76.3 + "@react-native/gradle-plugin": 0.76.3 + "@react-native/js-polyfills": 0.76.3 + "@react-native/normalize-colors": 0.76.3 + "@react-native/virtualized-lists": 0.76.3 + abort-controller: ^3.0.0 + anser: ^1.4.9 + ansi-regex: ^5.0.0 + babel-jest: ^29.7.0 + babel-plugin-syntax-hermes-parser: ^0.23.1 + base64-js: ^1.5.1 + chalk: ^4.0.0 + commander: ^12.0.0 + event-target-shim: ^5.0.1 + flow-enums-runtime: ^0.0.6 + glob: ^7.1.1 + invariant: ^2.2.4 + jest-environment-node: ^29.6.3 + jsc-android: ^250231.0.0 + memoize-one: ^5.0.0 + metro-runtime: ^0.81.0 + metro-source-map: ^0.81.0 + mkdirp: ^0.5.1 + nullthrows: ^1.1.1 + pretty-format: ^29.7.0 + promise: ^8.3.0 + react-devtools-core: ^5.3.1 + react-refresh: ^0.14.0 + regenerator-runtime: ^0.13.2 + scheduler: 0.24.0-canary-efb381bbf-20230505 + semver: ^7.1.3 + stacktrace-parser: ^0.1.10 + whatwg-fetch: ^3.0.0 + ws: ^6.2.3 + yargs: ^17.6.2 + peerDependencies: + "@types/react": ^18.2.6 + react: ^18.2.0 + peerDependenciesMeta: + "@types/react": + optional: true + bin: + react-native: cli.js + checksum: 0a2fbb7c1ff0057f69b23447980e912bc42df1c1e6c4be504f8e1d4c7c2182b3ca02b5f217bdf89b82a07d523b1e0e0f3124f3cf5f5876f5fa47f845cdba1c7a + languageName: node + linkType: hard + "react-refresh@npm:^0.14.0, react-refresh@npm:^0.14.2": version: 0.14.2 resolution: "react-refresh@npm:0.14.2" From 1a6f2f5465af36a6e36db3170949a2d4e8e560bd Mon Sep 17 00:00:00 2001 From: Tim Roberts Date: Tue, 3 Dec 2024 09:08:26 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=A6=BA=20guard=20against=20NaN=20inpu?= =?UTF-8?q?ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DurationScroll/index.tsx | 2 +- src/components/TimerPicker/index.tsx | 22 +++++++++++---------- src/components/TimerPickerModal/index.tsx | 11 ++++++----- src/utils/getSafeInitialValue.ts | 24 +++++++++++++++++++++++ 4 files changed, 43 insertions(+), 16 deletions(-) create mode 100644 src/utils/getSafeInitialValue.ts diff --git a/src/components/DurationScroll/index.tsx b/src/components/DurationScroll/index.tsx index ab9ac33..6953187 100644 --- a/src/components/DurationScroll/index.tsx +++ b/src/components/DurationScroll/index.tsx @@ -77,7 +77,7 @@ const DurationScroll = forwardRef( if (!disableInfiniteScroll && repeatNumbersNTimes < 2) { return 2; - } else if (repeatNumbersNTimes < 1) { + } else if (repeatNumbersNTimes < 1 || isNaN(repeatNumbersNTimes)) { return 1; } diff --git a/src/components/TimerPicker/index.tsx b/src/components/TimerPicker/index.tsx index 234c006..bcdf214 100644 --- a/src/components/TimerPicker/index.tsx +++ b/src/components/TimerPicker/index.tsx @@ -9,6 +9,7 @@ import React, { import { View } from "react-native"; +import { getSafeInitialValue } from "../../utils/getSafeInitialValue"; import DurationScroll from "../DurationScroll"; import type { DurationScrollRef } from "../DurationScroll/types"; @@ -57,7 +58,7 @@ const TimerPicker = forwardRef( } = props; const safePadWithNItems = useMemo(() => { - if (padWithNItems < 0) { + if (padWithNItems < 0 || isNaN(padWithNItems)) { return 0; } @@ -70,6 +71,16 @@ const TimerPicker = forwardRef( return Math.round(padWithNItems); }, [hideHours, padWithNItems]); + const safeInitialValue = useMemo( + () => + getSafeInitialValue({ + hours: initialValue?.hours, + minutes: initialValue?.minutes, + seconds: initialValue?.seconds, + }), + [initialValue?.hours, initialValue?.minutes, initialValue?.seconds] + ); + const styles = useMemo( () => generateStyles(customStyles, { @@ -79,15 +90,6 @@ const TimerPicker = forwardRef( [safePadWithNItems, customStyles] ); - const safeInitialValue = useMemo( - () => ({ - hours: initialValue?.hours ?? 0, - minutes: initialValue?.minutes ?? 0, - seconds: initialValue?.seconds ?? 0, - }), - [initialValue?.hours, initialValue?.minutes, initialValue?.seconds] - ); - const [selectedHours, setSelectedHours] = useState( safeInitialValue.hours ); diff --git a/src/components/TimerPickerModal/index.tsx b/src/components/TimerPickerModal/index.tsx index 8fc4c5f..770c151 100644 --- a/src/components/TimerPickerModal/index.tsx +++ b/src/components/TimerPickerModal/index.tsx @@ -9,6 +9,7 @@ import React, { import { View, Text, TouchableOpacity } from "react-native"; +import { getSafeInitialValue } from "../../utils/getSafeInitialValue"; import Modal from "../Modal"; import TimerPicker from "../TimerPicker"; import type { TimerPickerRef } from "../TimerPicker/types"; @@ -44,11 +45,11 @@ const TimerPickerModal = forwardRef( const timerPickerRef = useRef(null); - const safeInitialValue = { - hours: initialValue?.hours ?? 0, - minutes: initialValue?.minutes ?? 0, - seconds: initialValue?.seconds ?? 0, - }; + const safeInitialValue = getSafeInitialValue({ + hours: initialValue?.hours, + minutes: initialValue?.minutes, + seconds: initialValue?.seconds, + }); const [selectedDuration, setSelectedDuration] = useState(safeInitialValue); diff --git a/src/utils/getSafeInitialValue.ts b/src/utils/getSafeInitialValue.ts new file mode 100644 index 0000000..5f0aef2 --- /dev/null +++ b/src/utils/getSafeInitialValue.ts @@ -0,0 +1,24 @@ +export const getSafeInitialValue = ( + initialValue: + | { + hours?: number; + minutes?: number; + seconds?: number; + } + | undefined +) => ({ + hours: + typeof initialValue?.hours === "number" && !isNaN(initialValue?.hours) + ? initialValue.hours + : 0, + minutes: + typeof initialValue?.minutes === "number" && + !isNaN(initialValue?.minutes) + ? initialValue.minutes + : 0, + seconds: + typeof initialValue?.seconds === "number" && + !isNaN(initialValue?.seconds) + ? initialValue.seconds + : 0, +}); From 895299a6a73d40de699a6dec23329c3e779d600c Mon Sep 17 00:00:00 2001 From: Tim Roberts Date: Tue, 3 Dec 2024 11:25:35 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=90=9B=20fix=20snapToOffsets=20not=20?= =?UTF-8?q?always=20working=20for=20all=20pickers=20in=20`TimerPickerModal?= =?UTF-8?q?`=20(caused=20by=20FlatList=20not=20being=20able=20to=20properl?= =?UTF-8?q?y=20calculate=20its=20layout)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TimerPickerModal/index.tsx | 6 +- src/components/TimerPickerModal/styles.ts | 86 +++++++++++++++++------ 2 files changed, 67 insertions(+), 25 deletions(-) diff --git a/src/components/TimerPickerModal/index.tsx b/src/components/TimerPickerModal/index.tsx index 770c151..917ecb6 100644 --- a/src/components/TimerPickerModal/index.tsx +++ b/src/components/TimerPickerModal/index.tsx @@ -41,7 +41,9 @@ const TimerPickerModal = forwardRef( ...otherProps } = props; - const styles = generateStyles(customStyles); + const styles = generateStyles(customStyles, { + hasModalTitle: Boolean(modalTitle), + }); const timerPickerRef = useRef(null); @@ -151,7 +153,7 @@ const TimerPickerModal = forwardRef( {...otherProps} aggressivelyGetLatestDuration onDurationChange={durationChangeHandler} - styles={customStyles} + styles={styles.timerPickerStyles} /> - StyleSheet.create({ + customStyles: CustomTimerPickerModalStyles | undefined, + variables?: { + hasModalTitle: boolean; + } +) => { + const { + button: customButtonStyle, + buttonContainer: customButtonContainerStyle, + cancelButton: customCancelButtonStyle, + confirmButton: customConfirmButtonStyle, + container: customContainerStyle, + contentContainer: customContentContainerStyle, + modalTitle: customModalTitleStyle, + ...customTimerPickerStyles + } = customStyles ?? {}; + + return StyleSheet.create({ container: { justifyContent: "center", - alignItems: "center", overflow: "hidden", - ...customStyles?.container, + ...customContainerStyle, + // disable setting alignItems here because it can affect + // the FlatList's ability to calculate its layout, which can + // stop snapToOffsets working properly + alignItems: undefined, }, contentContainer: { backgroundColor: - customStyles?.backgroundColor ?? - (customStyles?.theme === "dark" + customTimerPickerStyles?.backgroundColor ?? + (customTimerPickerStyles?.theme === "dark" ? DARK_MODE_BACKGROUND_COLOR : LIGHT_MODE_BACKGROUND_COLOR), justifyContent: "center", alignItems: "center", borderRadius: 20, - padding: 20, - ...customStyles?.contentContainer, + overflow: "hidden", + ...customContentContainerStyle, + // disable setting padding here because it can affect + // the FlatList's ability to calculate its layout, which can + // stop snapToOffsets working properly + paddingHorizontal: 0, + paddingVertical: 0, }, buttonContainer: { flexDirection: "row", marginTop: 25, - ...customStyles?.buttonContainer, + marginBottom: 20, + ...customButtonContainerStyle, }, button: { marginHorizontal: 12, @@ -53,36 +76,53 @@ export const generateStyles = ( borderRadius: 10, fontSize: 16, overflow: "hidden", - ...customStyles?.text, - ...customStyles?.button, + ...customTimerPickerStyles?.text, + ...customButtonStyle, }, cancelButton: { borderColor: "gray", color: - customStyles?.theme === "dark" ? DARK_MODE_TEXT_COLOR : "gray", + customTimerPickerStyles?.theme === "dark" + ? DARK_MODE_TEXT_COLOR + : "gray", backgroundColor: - customStyles?.theme === "dark" ? "gray" : undefined, - ...customStyles?.text, - ...customStyles?.cancelButton, + customTimerPickerStyles?.theme === "dark" ? "gray" : undefined, + ...customTimerPickerStyles?.text, + ...customCancelButtonStyle, }, confirmButton: { borderColor: "green", color: - customStyles?.theme === "dark" ? DARK_MODE_TEXT_COLOR : "green", + customTimerPickerStyles?.theme === "dark" + ? DARK_MODE_TEXT_COLOR + : "green", backgroundColor: - customStyles?.theme === "dark" ? "green" : undefined, - ...customStyles?.text, - ...customStyles?.confirmButton, + customTimerPickerStyles?.theme === "dark" ? "green" : undefined, + ...customTimerPickerStyles?.text, + ...customConfirmButtonStyle, }, modalTitle: { fontSize: 24, fontWeight: "600", + marginTop: 20, marginBottom: 15, color: - customStyles?.theme === "dark" + customTimerPickerStyles?.theme === "dark" ? DARK_MODE_TEXT_COLOR : LIGHT_MODE_TEXT_COLOR, - ...customStyles?.text, - ...customStyles?.modalTitle, + ...customTimerPickerStyles?.text, + ...customModalTitleStyle, + }, + timerPickerStyles: { + ...customTimerPickerStyles, + pickerContainer: { + // set padding here instead of on modal content container because it can affect + // the FlatList's ability to calculate its layout, which can + // stop snapToOffsets working properly + paddingHorizontal: 20, + paddingTop: !variables?.hasModalTitle ? 20 : 0, + ...(customTimerPickerStyles?.pickerContainer ?? {}), + }, }, }); +}; From e0f677476ce5656d39b332f37bacf927813b0d68 Mon Sep 17 00:00:00 2001 From: Tim Roberts Date: Tue, 3 Dec 2024 11:27:00 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=94=96=20bump=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0f25fdf..fdf5d0a 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "url": "https://github.com/troberts-28" }, "license": "MIT", - "version": "2.0.0", + "version": "2.0.1", "main": "dist/commonjs/index.js", "module": "dist/module/index.js", "types": "dist/typescript/index.d.ts",