Skip to content

Commit 1aa3349

Browse files
committed
fix: πŸ› upgrade to sdk 51
βœ… Closes: #235
1 parent da97168 commit 1aa3349

File tree

3 files changed

+3075
-3281
lines changed

3 files changed

+3075
-3281
lines changed

β€Žhackathon/spacecraft/.storybook/storybook.requires.ts

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
/* do not change this file, it is auto generated by storybook. */
22

3-
import { start } from "@storybook/react-native";
3+
import {
4+
start,
5+
prepareStories,
6+
getProjectAnnotations,
7+
} from "@storybook/react-native";
48

59
import "@storybook/addon-ondevice-notes/register";
610
import "@storybook/addon-ondevice-controls/register";
@@ -36,14 +40,37 @@ const normalizedStories = [
3640
},
3741
];
3842

39-
// @ts-ignore
43+
declare global {
44+
var view: ReturnType<typeof start>;
45+
var STORIES: typeof normalizedStories;
46+
}
47+
48+
const annotations = [
49+
require("./preview"),
50+
require("@storybook/react-native/dist/preview"),
51+
require("@storybook/addon-actions/preview"),
52+
];
53+
4054
global.STORIES = normalizedStories;
4155

42-
export const view = start({
43-
annotations: [
44-
require("./preview"),
45-
require("@storybook/react-native/dist/preview"),
46-
require("@storybook/addon-actions/preview"),
47-
],
48-
storyEntries: normalizedStories,
49-
});
56+
// @ts-ignore
57+
module?.hot?.accept?.();
58+
59+
if (!global.view) {
60+
global.view = start({
61+
annotations,
62+
storyEntries: normalizedStories,
63+
});
64+
} else {
65+
const { importMap } = prepareStories({ storyEntries: normalizedStories });
66+
67+
global.view._preview.onStoriesChanged({
68+
importFn: async (importPath: string) => importMap[importPath],
69+
});
70+
71+
global.view._preview.onGetProjectAnnotationsChanged({
72+
getProjectAnnotations: getProjectAnnotations(global.view, annotations),
73+
});
74+
}
75+
76+
export const view = global.view;

β€Žhackathon/spacecraft/package.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
]
2525
},
2626
"dependencies": {
27-
"@expo/metro-runtime": "~3.1.3",
27+
"@expo/metro-runtime": "~3.2.1",
2828
"@expo/vector-icons": "^14.0.0",
29-
"@react-native-async-storage/async-storage": "1.21.0",
29+
"@react-native-async-storage/async-storage": "1.23.1",
3030
"@react-native-community/masked-view": "0.1.11",
31-
"@react-native-community/netinfo": "11.1.0",
31+
"@react-native-community/netinfo": "11.3.1",
3232
"@react-navigation/bottom-tabs": "^6.5.5",
3333
"@react-navigation/native": "^6.1.1",
3434
"@react-navigation/native-stack": "^6.9.7",
@@ -37,34 +37,34 @@
3737
"babel-core": "^7.0.0-bridge.0",
3838
"babel-jest": "^29.5.0",
3939
"deepmerge": "^4.3.1",
40-
"expo": "~50.0.17",
41-
"expo-application": "~5.8.4",
42-
"expo-constants": "~15.4.6",
43-
"expo-image": "~1.10.6",
44-
"expo-linking": "~6.2.2",
45-
"expo-status-bar": "~1.11.1",
46-
"expo-store-review": "~6.8.3",
47-
"expo-updates": "~0.24.12",
48-
"expo-web-browser": "~12.8.2",
40+
"expo": "^51.0.0",
41+
"expo-application": "~5.9.1",
42+
"expo-constants": "~16.0.1",
43+
"expo-image": "~1.12.9",
44+
"expo-linking": "~6.3.1",
45+
"expo-status-bar": "~1.12.1",
46+
"expo-store-review": "~7.0.2",
47+
"expo-updates": "~0.25.14",
48+
"expo-web-browser": "~13.0.3",
4949
"react": "18.2.0",
5050
"react-currency-format": "^1.1.0",
51-
"react-dom": "^18.2.0",
52-
"react-native": "0.73.6",
53-
"react-native-gesture-handler": "~2.14.1",
51+
"react-dom": "18.2.0",
52+
"react-native": "0.74.1",
53+
"react-native-gesture-handler": "~2.16.1",
5454
"react-native-offline": "^6.0.0",
5555
"react-native-paper": "^5.12.2",
56-
"react-native-reanimated": "~3.6.2",
57-
"react-native-safe-area-context": "4.8.2",
58-
"react-native-screens": "~3.29.0",
56+
"react-native-reanimated": "~3.10.1",
57+
"react-native-safe-area-context": "4.10.1",
58+
"react-native-screens": "3.31.1",
5959
"react-native-vector-icons": "^10.0.3",
6060
"react-native-web": "~0.19.10",
6161
"rn-placeholder": "^3.0.3"
6262
},
6363
"devDependencies": {
64-
"@babel/core": "^7.23.7",
64+
"@babel/core": "^7.24.0",
6565
"@babel/preset-typescript": "^7.18.6",
66-
"@react-native-community/datetimepicker": "7.6.1",
67-
"@react-native-community/slider": "4.4.2",
66+
"@react-native-community/datetimepicker": "8.0.1",
67+
"@react-native-community/slider": "4.5.2",
6868
"@storybook/addon-controls": "^7.6.10",
6969
"@storybook/addon-ondevice-actions": "^7.6.15",
7070
"@storybook/addon-ondevice-backgrounds": "^7.6.15",
@@ -78,8 +78,8 @@
7878
"@testing-library/jest-native": "^5.4.3",
7979
"@testing-library/react-native": "^12.4.3",
8080
"@types/jest": "^29.5.4",
81-
"@types/react": "~18.2.48",
82-
"@types/react-dom": "~18.0.10",
81+
"@types/react": "~18.2.79",
82+
"@types/react-dom": "~18.2.25",
8383
"app-icon-badge": "^0.0.15",
8484
"babel-loader": "^9.1.3",
8585
"babel-plugin-module-resolver": "^5.0.0",
@@ -90,7 +90,7 @@
9090
"eslint-import-resolver-babel-plugin-root-import": "^1.1.1",
9191
"eslint-plugin-import": "^2.29.1",
9292
"jest": "^29.6.4",
93-
"jest-expo": "~50.0.4",
94-
"typescript": "^5.1.3"
93+
"jest-expo": "~51.0.2",
94+
"typescript": "~5.3.3"
9595
}
9696
}

0 commit comments

Comments
Β (0)