Skip to content

Commit

Permalink
Merge branch 'andrew_testing' into fix/text_formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-bierman authored May 15, 2024
2 parents 5deb02d + 6d52205 commit 5b8981f
Show file tree
Hide file tree
Showing 90 changed files with 972 additions and 768 deletions.
31 changes: 21 additions & 10 deletions .github/scripts/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (isCI) {
console.log('🔥 Generating .env.local files');

const autogeneratedComment =
'# This file is autogenerated. To make changes, modify the root level .env.local file and run bun install\n\n';
'# This file is autogenerated. To make changes, modify the root level .env.local file and run bun install. You might need to directly run bun postinstall to trigger the env shim script. \n\n';
const outputName = '.env.local';

// Read the .env file
Expand All @@ -35,9 +35,12 @@ const expoOutputPath = path.join(
const expoFileContent = envFileContent
.split('\n')
.map((line) => {
if (line.startsWith('PUBLIC_')) {
if (line.startsWith('PUBLIC_APP=')) {
return 'EXPO_PUBLIC_APP=expo';
} else if (line.startsWith('PUBLIC_')) {
return line.replace(/^PUBLIC_/, 'EXPO_PUBLIC_');
}
return line;
})
.join('\n');
const expoNoTelemetry = 'EXPO_NO_TELEMETRY=true';
Expand All @@ -60,7 +63,9 @@ const nextOutputPath = path.join(
const nextFileContent = envFileContent
.split('\n')
.map((line) => {
if (line.startsWith('PUBLIC_')) {
if (line.startsWith('PUBLIC_APP=')) {
return 'NEXT_PUBLIC_APP=next';
} else if (line.startsWith('PUBLIC_')) {
return line.replace(/^PUBLIC_/, 'NEXT_PUBLIC_');
}
})
Expand All @@ -81,8 +86,10 @@ const viteOutputPath = path.join(
const viteFileContent = envFileContent
.split('\n')
.map((line) => {
if (line.startsWith('PUBLIC_')) {
return line.replace(/^PUBLIC_/, 'VITE_');
if (line.startsWith('PUBLIC_APP=')) {
return 'VITE_PUBLIC_APP=vite';
} else if (line.startsWith('PUBLIC_')) {
return line.replace(/^PUBLIC_/, 'VITE_PUBLIC_');
}
})
.join('\n');
Expand All @@ -103,14 +110,18 @@ const tauriOutputPath = path.join(
const tauriFileContent = envFileContent
.split('\n')
.map((line) => {
if (line.startsWith('PUBLIC_')) {
if (line.startsWith('PUBLIC_APP=')) {
return 'VITE_PUBLIC_APP=tauri';
} else if (line.startsWith('PUBLIC_')) {
// We use Vite's env variables in Tauri
return line.replace(/^PUBLIC_/, 'VITE_');
return line.replace(/^PUBLIC_/, 'VITE_PUBLIC_');
}
})
.join('\n');
fs.writeFileSync(tauriOutputPath, `${autogeneratedComment}\n${tauriFileContent}`);

fs.writeFileSync(
tauriOutputPath,
`${autogeneratedComment}\n${tauriFileContent}`,
);

// TODO: Add wrangler env generation
/**
Expand All @@ -131,4 +142,4 @@ fs.writeFileSync(tauriOutputPath, `${autogeneratedComment}\n${tauriFileContent}`
// fs.writeFileSync(
// wranglerOutputPath,
// `${autogeneratedComment}\n${wranglerFileContent}\n${noD1Warning}`
// )
// )
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
mongodb-data
*.env
.env.local
.env.production
.env.old
node_modules
# yarn.lock
# dist
Expand Down
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ node_modules/
package-lock.json
package.json

# Next.js build directory
.next/
.vercel/

# Vite build directory
dist/

# README and other markdowns might be formatted, but if you're facing errors, you can ignore them
README.md

Expand Down
23 changes: 11 additions & 12 deletions apps/expo/app.config.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
import "dotenv/config";

import 'dotenv/config';

module.exports = ({ config }) => {

config.extra.NODE_ENV = process.env.NODE_ENV;
config.extra.CLIENT_URL = process.env.CLIENT_URL;
config.extra.MAPBOX_ACCESS_TOKEN = process.env.MAPBOX_ACCESS_TOKEN;
config.extra.API_URL = process.env.API_URL;

config.extra.EXPO_PUBLIC_NODE_ENV = process.env.EXPO_PUBLIC_NODE_ENV;
config.extra.EXPO_PUBLIC_CLIENT_URL = process.env.EXPO_PUBLIC_CLIENT_URL;
config.extra.EXPO_PUBLIC_MAPBOX_ACCESS_TOKEN = process.env.EXPO_PUBLIC_MAPBOX_ACCESS_TOKEN;
config.extra.EXPO_PUBLIC_MAPBOX_ACCESS_TOKEN =
process.env.EXPO_PUBLIC_MAPBOX_ACCESS_TOKEN;
config.extra.EXPO_PUBLIC_API_URL = process.env.EXPO_PUBLIC_API_URL;

return {
...config,
plugins: config.plugins.map(i => {
if (i[0] === "@rnmapbox/maps") {
plugins: config.plugins.map((i) => {
if (i[0] === '@rnmapbox/maps') {
return [
"@rnmapbox/maps",
'@rnmapbox/maps',
{
"RNMapboxMapsImpl": "mapbox",
"RNMapboxMapsDownloadToken": process.env.MAPBOX_DOWNLOADS_TOKEN
}
]
RNMapboxMapsImpl: 'mapbox',
RNMapboxMapsDownloadToken: process.env.MAPBOX_DOWNLOADS_TOKEN,
},
];
}
return i;
})
}),
};
};
2 changes: 1 addition & 1 deletion apps/expo/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ export default function HomeLayout() {
/>
</Provider>
);
}
}
67 changes: 65 additions & 2 deletions apps/vite/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,86 +162,149 @@ const ProfileSettingsIndexLazyRoute = ProfileSettingsIndexLazyImport.update({
declare module '@tanstack/react-router' {
interface FileRoutesByPath {
'/': {
id: '/'
path: '/'
fullPath: '/'
preLoaderRoute: typeof IndexImport
parentRoute: typeof rootRoute
}
'/destination/query': {
id: '/destination/query'
path: '/destination/query'
fullPath: '/destination/query'
preLoaderRoute: typeof DestinationQueryLazyImport
parentRoute: typeof rootRoute
}
'/pack/$id': {
id: '/pack/$id'
path: '/pack/$id'
fullPath: '/pack/$id'
preLoaderRoute: typeof PackIdLazyImport
parentRoute: typeof rootRoute
}
'/pack/create': {
id: '/pack/create'
path: '/pack/create'
fullPath: '/pack/create'
preLoaderRoute: typeof PackCreateLazyImport
parentRoute: typeof rootRoute
}
'/profile/$id': {
id: '/profile/$id'
path: '/profile/$id'
fullPath: '/profile/$id'
preLoaderRoute: typeof ProfileIdLazyImport
parentRoute: typeof rootRoute
}
'/trip/$tripId': {
id: '/trip/$tripId'
path: '/trip/$tripId'
fullPath: '/trip/$tripId'
preLoaderRoute: typeof TripTripIdLazyImport
parentRoute: typeof rootRoute
}
'/trip/create': {
id: '/trip/create'
path: '/trip/create'
fullPath: '/trip/create'
preLoaderRoute: typeof TripCreateLazyImport
parentRoute: typeof rootRoute
}
'/about/': {
id: '/about/'
path: '/about/'
fullPath: '/about/'
preLoaderRoute: typeof AboutIndexLazyImport
parentRoute: typeof rootRoute
}
'/appearance/': {
id: '/appearance/'
path: '/appearance/'
fullPath: '/appearance/'
preLoaderRoute: typeof AppearanceIndexLazyImport
parentRoute: typeof rootRoute
}
'/dashboard/': {
id: '/dashboard/'
path: '/dashboard/'
fullPath: '/dashboard/'
preLoaderRoute: typeof DashboardIndexLazyImport
parentRoute: typeof rootRoute
}
'/feed/': {
id: '/feed/'
path: '/feed/'
fullPath: '/feed/'
preLoaderRoute: typeof FeedIndexLazyImport
parentRoute: typeof rootRoute
}
'/items/': {
id: '/items/'
path: '/items/'
fullPath: '/items/'
preLoaderRoute: typeof ItemsIndexLazyImport
parentRoute: typeof rootRoute
}
'/map/': {
id: '/map/'
path: '/map/'
fullPath: '/map/'
preLoaderRoute: typeof MapIndexLazyImport
parentRoute: typeof rootRoute
}
'/maps/': {
id: '/maps/'
path: '/maps/'
fullPath: '/maps/'
preLoaderRoute: typeof MapsIndexLazyImport
parentRoute: typeof rootRoute
}
'/packs/': {
id: '/packs/'
path: '/packs/'
fullPath: '/packs/'
preLoaderRoute: typeof PacksIndexLazyImport
parentRoute: typeof rootRoute
}
'/password-reset/': {
id: '/password-reset/'
path: '/password-reset/'
fullPath: '/password-reset/'
preLoaderRoute: typeof PasswordResetIndexLazyImport
parentRoute: typeof rootRoute
}
'/profile/': {
id: '/profile/'
path: '/profile/'
fullPath: '/profile/'
preLoaderRoute: typeof ProfileIndexLazyImport
parentRoute: typeof rootRoute
}
'/register/': {
id: '/register/'
path: '/register/'
fullPath: '/register/'
preLoaderRoute: typeof RegisterIndexLazyImport
parentRoute: typeof rootRoute
}
'/sign-in/': {
id: '/sign-in/'
path: '/sign-in/'
fullPath: '/sign-in/'
preLoaderRoute: typeof SignInIndexLazyImport
parentRoute: typeof rootRoute
}
'/trips/': {
id: '/trips/'
path: '/trips/'
fullPath: '/trips/'
preLoaderRoute: typeof TripsIndexLazyImport
parentRoute: typeof rootRoute
}
'/profile/settings/': {
id: '/profile/settings/'
path: '/profile/settings/'
fullPath: '/profile/settings/'
preLoaderRoute: typeof ProfileSettingsIndexLazyImport
parentRoute: typeof rootRoute
}
Expand All @@ -250,7 +313,7 @@ declare module '@tanstack/react-router' {

// Create and export the route tree

export const routeTree = rootRoute.addChildren([
export const routeTree = rootRoute.addChildren({
IndexRoute,
DestinationQueryLazyRoute,
PackIdLazyRoute,
Expand All @@ -272,6 +335,6 @@ export const routeTree = rootRoute.addChildren([
SignInIndexLazyRoute,
TripsIndexLazyRoute,
ProfileSettingsIndexLazyRoute,
])
})

/* prettier-ignore-end */
5 changes: 1 addition & 4 deletions packages/app/components/card/CustomCardHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ export const CustomCardHeader = ({ data, title, link, actionsComponent }) => {
return (
<>
<RStack style={{ flex: 1 }}>
{typeof title === "string" ?
<RText>{title}</RText>
: title
}
{typeof title === 'string' ? <RText>{title}</RText> : title}
</RStack>
<View>
<RLink href={`/profile/${data.owner_id.id || data.owner_id}`} style={{ textDecoration: 'none' }}>
Expand Down
12 changes: 10 additions & 2 deletions packages/app/components/carousel/ScrollButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,16 @@ const ScrollButton = ({ direction, onPress, disabled }: ScrollButtonProps) => {
style={styles.scrollButton}
disabled={disabled}
>
{direction === 'left' && <Text style={[styles.iconStyles, {color: isDark? 'white': 'grey', }]}>&lang;</Text>}
{direction != 'left' && <Text style={[styles.iconStyles, {color: isDark? 'white': 'grey', }]}>&rang;</Text>}
{direction === 'left' && (
<Text style={[styles.iconStyles, { color: isDark ? 'white' : 'grey' }]}>
&lang;
</Text>
)}
{direction != 'left' && (
<Text style={[styles.iconStyles, { color: isDark ? 'white' : 'grey' }]}>
&rang;
</Text>
)}
</TouchableOpacity>
);
};
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/carousel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const Carousel: React.FC<CarouselProps> = ({ children = [], itemWidth }) => {
const scrollToIndex = (index: number) => {
if (index >= 0 && index < children.length && scrollViewRef.current) {
scrollViewRef.current.scrollTo({
x: index * (itemWidth + 20),
x: index * 220,
y: 0,
animated: true,
});
Expand Down
14 changes: 3 additions & 11 deletions packages/app/components/itemtable/itemTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export const ItemsTable = ({
* @return {undefined} This function doesn't return anything.
*/
const handleNextPage = () => {
setPage(page + 1)
setPage(page + 1);
};
/**
* Handles the action of going to the previous page.
Expand Down Expand Up @@ -236,11 +236,7 @@ export const ItemsTable = ({
disabled={page < 2}
onPress={handlePreviousPage}
>
<AntDesign
name="left"
size={16}
color='white'
/>
<AntDesign name="left" size={16} color="white" />
</RButton>
<RButton
style={{
Expand All @@ -255,11 +251,7 @@ export const ItemsTable = ({
disabled={page === totalPages}
onPress={handleNextPage}
>
<AntDesign
name="right"
size={16}
color='white'
/>
<AntDesign name="right" size={16} color="white" />
</RButton>
</View>
</View>
Expand Down
Loading

0 comments on commit 5b8981f

Please sign in to comment.