Skip to content

Commit 11980c6

Browse files
committed
chore: Normalize base structure to match with/green-stack
1 parent a1d639f commit 11980c6

21 files changed

+4563
-2806
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ npm run dev
2222

2323
Open [http://localhost:3000](http://localhost:3000) with your browser to see your **Next.js 14** app on web.
2424

25-
Install and/or open the [Expo Go](https://expo.io/client) app on your phone and scan the QR code to test your **Expo SDK 50** app on mobile.
25+
Install and/or open the [Expo Go](https://expo.io/client) app on your phone and scan the QR code to test your **Expo SDK 51** app on mobile.
2626

2727
## Documentation
2828

apps/expo/app.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"expo": {
3-
"name": "@aetherspace/universal-app-router",
4-
"slug": "aetherspace-universal-app-router",
5-
"scheme": "aetherspace-universal-app-router",
3+
"name": "@fullproduct-dot-dev/universal-app-router",
4+
"slug": "fullproduct-dot-dev-universal-app-router",
5+
"scheme": "fullproduct-dot-dev-universal-app-router",
66
"plugins": [
77
"expo-router"
88
],

apps/expo/babel.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// babel.config.js
22
module.exports = function (api) {
3-
api.cache(true);
3+
api.cache(true)
44
return {
55
presets: ["babel-preset-expo"],
6-
};
7-
};
6+
}
7+
}

apps/expo/metro.config.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
// -i- Copied from https://docs.expo.dev/guides/monorepos/#modify-the-metro-config
2-
const { getDefaultConfig } = require('expo/metro-config');
3-
const path = require('path');
2+
const { getDefaultConfig } = require('expo/metro-config')
3+
const path = require('path')
44

55
// Find the project and workspace directories
6-
const projectRoot = __dirname;
7-
8-
// This can be replaced with `find-yarn-workspace-root`
9-
const workspaceRoot = path.resolve(projectRoot, '../..');
10-
const config = getDefaultConfig(projectRoot);
6+
const projectRoot = __dirname
7+
const workspaceRoot = path.resolve(projectRoot, '../..')
8+
const config = getDefaultConfig(projectRoot)
119

1210
// 1. Watch all files within the monorepo
13-
config.watchFolders = [workspaceRoot];
11+
config.watchFolders = [workspaceRoot]
1412

1513
// 2. Let Metro know where to resolve packages and in what order
1614
config.resolver.nodeModulesPaths = [
1715
path.resolve(projectRoot, 'node_modules'),
1816
path.resolve(workspaceRoot, 'node_modules'),
19-
];
17+
]
2018

2119
// 3. Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths`
22-
// config.resolver.disableHierarchicalLookup = true;
20+
// config.resolver.disableHierarchicalLookup = true
2321

2422
// Export the modified config
25-
module.exports = config;
23+
module.exports = config

apps/expo/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
"private": true,
55
"main": "index.js",
66
"dependencies": {
7-
"@expo/metro-runtime": "^3.1.1",
8-
"expo": "^50.0.1",
9-
"expo-constants": "~15.4.5",
10-
"expo-linking": "~6.2.2",
11-
"expo-router": "~3.4.4",
12-
"expo-status-bar": "~1.11.1",
7+
"@expo/metro-runtime": "^3.2.1",
8+
"expo": "^51.0.8",
9+
"expo-constants": "~16.0.1",
10+
"expo-linking": "~6.3.1",
11+
"expo-router": "~3.5.14",
12+
"expo-status-bar": "~1.12.1",
1313
"react": "18.2.0",
1414
"react-dom": "18.2.0",
15-
"react-native": "0.73.2",
16-
"react-native-safe-area-context": "4.8.2",
17-
"react-native-screens": "~3.29.0",
18-
"react-native-web": "~0.19.6",
19-
"expo-image": "~1.10.6"
15+
"react-native": "0.74.1",
16+
"react-native-safe-area-context": "4.10.1",
17+
"react-native-screens": "~3.31.1",
18+
"react-native-web": "~0.19.11",
19+
"expo-image": "~1.12.9"
2020
},
2121
"devDependencies": {
2222
"@babel/core": "^7.19.3",

apps/expo/tsconfig.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
{
22
"extends": "@app/core/tsconfig",
3-
"include": ["**/*.ts", "**/*.tsx"],
3+
"include": [
4+
"**/*.ts",
5+
"**/*.tsx",
6+
"../../features/**/*.tsx",
7+
"../../features/**/*.ts",
8+
"../../packages/**/*.tsx",
9+
"../../packages/**/*.ts"
10+
],
411
"exclude": ["node_modules"]
512
}

apps/next/app/Document.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import UniversalRootLayout from '@app/core/screens/UniversalRootLayout'
2+
import UniversalRootLayout from '@app/screens/UniversalRootLayout'
33
import ServerStylesProvider from './ServerStylesProvider'
44
import '../global.css'
55

@@ -16,7 +16,7 @@ const Document = (props: { children: React.ReactNode }) => {
1616
// -- Render --
1717

1818
return (
19-
<html suppressHydrationWarning>
19+
<html lang="en" suppressHydrationWarning>
2020
<head>
2121
{/* - Title & Keywords - */}
2222
<title>Universal App Router</title>
@@ -26,7 +26,9 @@ const Document = (props: { children: React.ReactNode }) => {
2626
<meta name="viewport" content="width=device-width, initial-scale=1" />
2727
</head>
2828
<body>
29-
<UniversalRootLayout>{children}</UniversalRootLayout>
29+
<UniversalRootLayout>
30+
{children}
31+
</UniversalRootLayout>
3032
</body>
3133
</html>
3234
)

apps/next/app/NextClientRootLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22
import React from 'react'
3-
import UniversalAppProviders from '@app/core/screens/UniversalAppProviders'
3+
import UniversalAppProviders from '@app/screens/UniversalAppProviders'
44

55
// -i- This is a regular react client component
66
// -i- It's still rendered on the server during SSR, but it also hydrates on the client

apps/next/app/ServerStylesProvider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import React from 'react'
44
import { AppRegistry } from 'react-native'
55
import { useServerInsertedHTML } from 'next/navigation'
6-
import UniversalRootLayout from '@app/core/screens/UniversalRootLayout'
6+
import UniversalRootLayout from '@app/screens/UniversalRootLayout'
77

88
// -i- This is a regular react client component
99
// -i- However, it is rendered on the server during SSR
@@ -27,7 +27,7 @@ const ServerStylesProvider = (props: { children: React.ReactNode }) => {
2727
return (
2828
<>
2929
{reactNativeStyleElement}
30-
{/* TODO: Insert other SSR'd styles here */}
30+
{/* OPTIONAL: Insert other SSR'd styles here? */}
3131
</>
3232
)
3333
})

apps/next/babel.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// babel.config.js
22
module.exports = function (api) {
3-
api.cache(true);
3+
api.cache(true)
44
return {
55
presets: ["babel-preset-expo"],
6-
};
7-
};
6+
}
7+
}

0 commit comments

Comments
 (0)