Skip to content

Commit 60951de

Browse files
committed
feat: 🎸 add spacecraft with expo sdk 54 + expo router \
1 parent 0709691 commit 60951de

58 files changed

Lines changed: 22802 additions & 2 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

SPACECRAFT_PROGRESS.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Spacecraft - Progression
2+
3+
Suivi des étapes pour refaire Spacecraft avec la nouvelle méthode.
4+
5+
---
6+
7+
## 1. Foundation
8+
9+
- [x] 01 - Introduction
10+
- [x] 02 - Project setup
11+
- [x] 03 - Scroll on mobile
12+
- [x] 04 - Render a list of data
13+
- [x] 05 - Named and default import / exports
14+
15+
## 2. Data
16+
17+
- [x] 01 - How to debug with React Native
18+
- [x] 02 - Fetching data with `react-query`
19+
- [x] 03 - Add an `Offline` component
20+
21+
## 3. Ecosystem
22+
23+
- [x] 01 - React Native Extensions in Visual Studio Code
24+
- [x] 02 - Integrating React Native with Linters
25+
- [x] 03 - TypeScript with the React Native Ecosystem
26+
- [x] 04 - Design System in React Native with Storybook
27+
- [x] 05 - Unit Testing with React Native
28+
- [x] 06 - End-to-End Testing with Maestro
29+
30+
## 4. Expo Router
31+
32+
- [x] 01 - File-based Routing
33+
- [x] 02 - Passing data with Dynamic Routes
34+
- [x] 03 - Protected Routes & Auth Flow
35+
- [x] 04 - Tab Navigation
36+
- [x] 05 - Auth Persistence & Splash Screen
37+
38+
## 5. Release
39+
40+
- [ ] 01 - Release with EAS
41+
- [ ] 02 - Configuration and Environment variables
42+
- [ ] 03 - Strategies for beta testing on real device
43+
44+
---
45+
46+
## Notes
47+
48+
_Ajouter des notes au fur et à mesure de la progression._
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
2+
3+
# dependencies
4+
node_modules/
5+
6+
# Expo
7+
.expo/
8+
dist/
9+
web-build/
10+
expo-env.d.ts
11+
12+
# Native
13+
.kotlin/
14+
*.orig.*
15+
*.jks
16+
*.p8
17+
*.p12
18+
*.key
19+
*.mobileprovision
20+
21+
# Metro
22+
.metro-health-check*
23+
24+
# debug
25+
npm-debug.*
26+
yarn-debug.*
27+
yarn-error.*
28+
29+
# macOS
30+
.DS_Store
31+
*.pem
32+
33+
# local env files
34+
.env*.local
35+
36+
# typescript
37+
*.tsbuildinfo
38+
39+
# generated native folders
40+
/ios
41+
/android
42+
43+
*storybook.log
44+
storybook-static
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "http://json.schemastore.org/prettierrc",
3+
"semi": true,
4+
"singleAttributePerLine": true,
5+
"trailingComma": "all",
6+
"tabWidth": 2,
7+
"singleQuote": false
8+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import AsyncStorage from "@react-native-async-storage/async-storage";
2+
import { view } from "./storybook.requires";
3+
4+
const StorybookUIRoot = view.getStorybookUI({
5+
storage: {
6+
getItem: AsyncStorage.getItem,
7+
setItem: AsyncStorage.setItem,
8+
},
9+
});
10+
11+
export default StorybookUIRoot;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type { StorybookConfig } from "@storybook/react-native";
2+
3+
const main: StorybookConfig = {
4+
stories: ["../src/components/**/*.stories.?(ts|tsx|js|jsx)"],
5+
addons: [
6+
"@storybook/addon-ondevice-notes",
7+
"@storybook/addon-ondevice-controls",
8+
"@storybook/addon-ondevice-backgrounds",
9+
"@storybook/addon-ondevice-actions",
10+
],
11+
framework: "@storybook/react-native",
12+
};
13+
14+
export default main;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { withBackgrounds } from "@storybook/addon-ondevice-backgrounds";
2+
import type { Preview } from "@storybook/react-native";
3+
4+
const preview: Preview = {
5+
decorators: [withBackgrounds],
6+
7+
parameters: {
8+
backgrounds: {
9+
default: "plain",
10+
values: [
11+
{ name: "plain", value: "white" },
12+
{ name: "warm", value: "hotpink" },
13+
{ name: "cool", value: "deepskyblue" },
14+
],
15+
},
16+
actions: { argTypesRegex: "^on[A-Z].*" },
17+
controls: {
18+
matchers: {
19+
color: /(background|color)$/i,
20+
date: /Date$/,
21+
},
22+
},
23+
},
24+
};
25+
26+
export default preview;
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/* do not change this file, it is auto generated by storybook. */
2+
import { start, updateView, View } from "@storybook/react-native";
3+
4+
import "@storybook/addon-ondevice-notes/register";
5+
import "@storybook/addon-ondevice-controls/register";
6+
import "@storybook/addon-ondevice-backgrounds/register";
7+
import "@storybook/addon-ondevice-actions/register";
8+
9+
const normalizedStories = [
10+
{
11+
titlePrefix: "",
12+
directory: "./src/components",
13+
files: "**/*.stories.?(ts|tsx|js|jsx)",
14+
importPathMatcher:
15+
/^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/,
16+
// @ts-ignore
17+
req: require.context(
18+
"../src/components",
19+
true,
20+
/^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/,
21+
),
22+
},
23+
];
24+
25+
declare global {
26+
var view: View;
27+
var STORIES: typeof normalizedStories;
28+
}
29+
30+
const annotations = [
31+
require("./preview"),
32+
require("@storybook/react-native/preview"),
33+
];
34+
35+
global.STORIES = normalizedStories;
36+
37+
// @ts-ignore
38+
module?.hot?.accept?.();
39+
40+
if (!global.view) {
41+
global.view = start({
42+
annotations,
43+
storyEntries: normalizedStories,
44+
});
45+
} else {
46+
updateView(global.view, annotations, normalizedStories);
47+
}
48+
49+
export const view: View = global.view;
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import React from "react";
2+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
3+
import { Provider as PaperProvider } from "react-native-paper";
4+
5+
import { NetworkProvider } from "./src/context/Network";
6+
import { LoginScreen } from "./src/screens/LoginScreen";
7+
import { TermsScreen } from "./src/screens/TermsScreen";
8+
import { StarshipFeedScreen } from "./src/screens/StarshipFeedScreen";
9+
10+
const queryClient = new QueryClient();
11+
12+
function App() {
13+
return (
14+
<QueryClientProvider client={queryClient}>
15+
<PaperProvider>
16+
<NetworkProvider>
17+
{/* <LoginScreen /> */}
18+
{/* <TermsScreen /> */}
19+
<StarshipFeedScreen />
20+
</NetworkProvider>
21+
</PaperProvider>
22+
</QueryClientProvider>
23+
);
24+
}
25+
26+
let AppEntryPoint = App;
27+
28+
if (process.env.EXPO_PUBLIC_STORYBOOK_ENABLED === "true") {
29+
AppEntryPoint = require("./.rnstorybook").default;
30+
}
31+
32+
export default AppEntryPoint;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"count":37,"next":"https://swapi.py4e.com/api/starships/?page=2","previous":null,"results":[{"name":"CR90 corvette","model":"CR90 corvette","manufacturer":"Corellian Engineering Corporation","cost_in_credits":"3500000","length":"150","max_atmosphering_speed":"950","crew":"30-165","passengers":"600","cargo_capacity":"3000000","consumables":"1 year","hyperdrive_rating":"2.0","MGLT":"60","starship_class":"corvette","pilots":[],"films":["https://swapi.py4e.com/api/films/1/","https://swapi.py4e.com/api/films/3/","https://swapi.py4e.com/api/films/6/"],"created":"2014-12-10T14:20:33.369000Z","edited":"2014-12-20T21:23:49.867000Z","url":"https://swapi.py4e.com/api/starships/2/"},{"name":"Star Destroyer","model":"Imperial I-class Star Destroyer","manufacturer":"Kuat Drive Yards","cost_in_credits":"150000000","length":"1,600","max_atmosphering_speed":"975","crew":"47,060","passengers":"n/a","cargo_capacity":"36000000","consumables":"2 years","hyperdrive_rating":"2.0","MGLT":"60","starship_class":"Star Destroyer","pilots":[],"films":["https://swapi.py4e.com/api/films/1/","https://swapi.py4e.com/api/films/2/","https://swapi.py4e.com/api/films/3/"],"created":"2014-12-10T15:08:19.848000Z","edited":"2014-12-20T21:23:49.870000Z","url":"https://swapi.py4e.com/api/starships/3/"},{"name":"Sentinel-class landing craft","model":"Sentinel-class landing craft","manufacturer":"Sienar Fleet Systems, Cyngus Spaceworks","cost_in_credits":"240000","length":"38","max_atmosphering_speed":"1000","crew":"5","passengers":"75","cargo_capacity":"180000","consumables":"1 month","hyperdrive_rating":"1.0","MGLT":"70","starship_class":"landing craft","pilots":[],"films":["https://swapi.py4e.com/api/films/1/"],"created":"2014-12-10T15:48:00.586000Z","edited":"2014-12-20T21:23:49.873000Z","url":"https://swapi.py4e.com/api/starships/5/"},{"name":"Death Star","model":"DS-1 Orbital Battle Station","manufacturer":"Imperial Department of Military Research, Sienar Fleet Systems","cost_in_credits":"1000000000000","length":"120000","max_atmosphering_speed":"n/a","crew":"342,953","passengers":"843,342","cargo_capacity":"1000000000000","consumables":"3 years","hyperdrive_rating":"4.0","MGLT":"10","starship_class":"Deep Space Mobile Battlestation","pilots":[],"films":["https://swapi.py4e.com/api/films/1/"],"created":"2014-12-10T16:36:50.509000Z","edited":"2014-12-20T21:26:24.783000Z","url":"https://swapi.py4e.com/api/starships/9/"},{"name":"Millennium Falcon","model":"YT-1300 light freighter","manufacturer":"Corellian Engineering Corporation","cost_in_credits":"100000","length":"34.37","max_atmosphering_speed":"1050","crew":"4","passengers":"6","cargo_capacity":"100000","consumables":"2 months","hyperdrive_rating":"0.5","MGLT":"75","starship_class":"Light freighter","pilots":["https://swapi.py4e.com/api/people/13/","https://swapi.py4e.com/api/people/14/","https://swapi.py4e.com/api/people/25/","https://swapi.py4e.com/api/people/31/"],"films":["https://swapi.py4e.com/api/films/1/","https://swapi.py4e.com/api/films/2/","https://swapi.py4e.com/api/films/3/","https://swapi.py4e.com/api/films/7/"],"created":"2014-12-10T16:59:45.094000Z","edited":"2014-12-20T21:23:49.880000Z","url":"https://swapi.py4e.com/api/starships/10/"},{"name":"Y-wing","model":"BTL Y-wing","manufacturer":"Koensayr Manufacturing","cost_in_credits":"134999","length":"14","max_atmosphering_speed":"1000km","crew":"2","passengers":"0","cargo_capacity":"110","consumables":"1 week","hyperdrive_rating":"1.0","MGLT":"80","starship_class":"assault starfighter","pilots":[],"films":["https://swapi.py4e.com/api/films/1/","https://swapi.py4e.com/api/films/2/","https://swapi.py4e.com/api/films/3/"],"created":"2014-12-12T11:00:39.817000Z","edited":"2014-12-20T21:23:49.883000Z","url":"https://swapi.py4e.com/api/starships/11/"},{"name":"X-wing","model":"T-65 X-wing","manufacturer":"Incom Corporation","cost_in_credits":"149999","length":"12.5","max_atmosphering_speed":"1050","crew":"1","passengers":"0","cargo_capacity":"110","consumables":"1 week","hyperdrive_rating":"1.0","MGLT":"100","starship_class":"Starfighter","pilots":["https://swapi.py4e.com/api/people/1/","https://swapi.py4e.com/api/people/9/","https://swapi.py4e.com/api/people/18/","https://swapi.py4e.com/api/people/19/"],"films":["https://swapi.py4e.com/api/films/1/","https://swapi.py4e.com/api/films/2/","https://swapi.py4e.com/api/films/3/"],"created":"2014-12-12T11:19:05.340000Z","edited":"2014-12-20T21:23:49.886000Z","url":"https://swapi.py4e.com/api/starships/12/"},{"name":"TIE Advanced x1","model":"Twin Ion Engine Advanced x1","manufacturer":"Sienar Fleet Systems","cost_in_credits":"unknown","length":"9.2","max_atmosphering_speed":"1200","crew":"1","passengers":"0","cargo_capacity":"150","consumables":"5 days","hyperdrive_rating":"1.0","MGLT":"105","starship_class":"Starfighter","pilots":["https://swapi.py4e.com/api/people/4/"],"films":["https://swapi.py4e.com/api/films/1/"],"created":"2014-12-12T11:21:32.991000Z","edited":"2014-12-20T21:23:49.889000Z","url":"https://swapi.py4e.com/api/starships/13/"},{"name":"Executor","model":"Executor-class star dreadnought","manufacturer":"Kuat Drive Yards, Fondor Shipyards","cost_in_credits":"1143350000","length":"19000","max_atmosphering_speed":"n/a","crew":"279,144","passengers":"38000","cargo_capacity":"250000000","consumables":"6 years","hyperdrive_rating":"2.0","MGLT":"40","starship_class":"Star dreadnought","pilots":[],"films":["https://swapi.py4e.com/api/films/2/","https://swapi.py4e.com/api/films/3/"],"created":"2014-12-15T12:31:42.547000Z","edited":"2014-12-20T21:23:49.893000Z","url":"https://swapi.py4e.com/api/starships/15/"},{"name":"Rebel transport","model":"GR-75 medium transport","manufacturer":"Gallofree Yards, Inc.","cost_in_credits":"unknown","length":"90","max_atmosphering_speed":"650","crew":"6","passengers":"90","cargo_capacity":"19000000","consumables":"6 months","hyperdrive_rating":"4.0","MGLT":"20","starship_class":"Medium transport","pilots":[],"films":["https://swapi.py4e.com/api/films/2/","https://swapi.py4e.com/api/films/3/"],"created":"2014-12-15T12:34:52.264000Z","edited":"2014-12-20T21:23:49.895000Z","url":"https://swapi.py4e.com/api/starships/17/"}]}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"expo": {
3+
"name": "spacecraft-expo-router",
4+
"slug": "spacecraft-expo-router",
5+
"version": "1.0.0",
6+
"orientation": "portrait",
7+
"icon": "./assets/icon.png",
8+
"userInterfaceStyle": "light",
9+
"newArchEnabled": true,
10+
"splash": {
11+
"image": "./assets/splash-icon.png",
12+
"resizeMode": "contain",
13+
"backgroundColor": "#ffffff"
14+
},
15+
"ios": {
16+
"supportsTablet": true
17+
},
18+
"android": {
19+
"adaptiveIcon": {
20+
"foregroundImage": "./assets/adaptive-icon.png",
21+
"backgroundColor": "#ffffff"
22+
},
23+
"edgeToEdgeEnabled": true,
24+
"predictiveBackGestureEnabled": false
25+
},
26+
"web": {
27+
"favicon": "./assets/favicon.png"
28+
},
29+
"scheme": "spacecraft",
30+
"experiments": {
31+
"typedRoutes": true
32+
},
33+
"plugins": [
34+
"expo-router",
35+
"@react-native-community/datetimepicker"
36+
]
37+
}
38+
}

0 commit comments

Comments
 (0)