Skip to content

Commit 865588e

Browse files
authored
Merge pull request #3246 from gluestack/fix/upgrade-v3
Fix/upgrade v3
2 parents a5f0774 + 3dc40fd commit 865588e

File tree

6 files changed

+23
-5
lines changed

6 files changed

+23
-5
lines changed

packages/gluestack-core/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @gluestack-ui/core
22

3+
## 3.0.11
4+
5+
### Patch Changes
6+
7+
- fix: added initialwindowmetrics to safeareaprovider
8+
39
## 3.0.10
410

511
### Patch Changes

packages/gluestack-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@gluestack-ui/core",
33
"description": "Universal UI components for React Native, Expo, and Next.js",
4-
"version": "3.0.10",
4+
"version": "3.0.11",
55
"main": "./lib/esm/index.js",
66
"module": "./lib/esm/index.js",
77
"types": "./lib/esm/index.d.ts",

packages/gluestack-core/src/toast/creator/ToastList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useKeyboardBottomInset } from '@gluestack-ui/utils/hooks';
33
import { Overlay } from '../../overlay/creator';
44
import React from 'react';
55
import { Platform, View } from 'react-native';
6-
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';
6+
import { initialWindowMetrics, SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';
77
import { OverlayAnimatePresence } from './OverlayAnimatePresence';
88
import { ToastContext } from './ToastContext';
99
import type { IToast, ToastPlacement } from './types';
@@ -92,7 +92,7 @@ export const ToastList = () => {
9292
>
9393
{toastInfo[position].map((toast: IToast) => {
9494
return (
95-
<SafeAreaProvider key={toast.id}>
95+
<SafeAreaProvider key={toast.id} initialMetrics={initialWindowMetrics}>
9696
<SafeAreaView style={{ pointerEvents: 'box-none' }}>
9797
<OverlayAnimatePresence
9898
visible={visibleToasts[toast.id]}

packages/gluestack-ui/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
## 0.4.9-alpha.0 (2023-07-21)
22

3+
## 3.0.9
4+
5+
### Patch Changes
6+
7+
- fix: update the upgrade flow to avoid uninstalling @gluestack-ui/core and @gluestack-ui/utils
8+
39
## 3.0.8
410

511
### Patch Changes

packages/gluestack-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gluestack-ui",
3-
"version": "3.0.8",
3+
"version": "3.0.9",
44
"main": "dist/index.js",
55
"bin": {
66
"gluestack-ui": "./dist/index.js"

packages/gluestack-ui/src/commands/upgrade.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,14 @@ export const upgrade = new Command()
446446
else if (fs.existsSync('pnpm-lock.yaml')) packageManager = 'pnpm';
447447
else if (fs.existsSync('bun.lockb')) packageManager = 'bun';
448448
await updateTailwindConfig();
449+
// Do not remove packages that we want to keep/install
450+
const retainSet = new Set(['@gluestack-ui/core', '@gluestack-ui/utils']);
451+
const packagesToRemove = oldPackages.filter(
452+
(pkg: string) => !retainSet.has(pkg)
453+
);
454+
// Remove old packages first, then install required ones
455+
removePackages(packagesToRemove, packageManager);
449456
installPackages(packageManager);
450-
removePackages(oldPackages, packageManager);
451457
cleanAndReinstall(packageManager);
452458
await updateRegistryFile();
453459
await updateNextConfig();

0 commit comments

Comments
 (0)